在iOS 7中,我们现在可以在视图和顶部布局指南之间添加约束,我认为这对于解决iOS7中的状态栏偏移问题非常有用(特别是当视图中没有导航栏时).
在故事板文件中,我可以轻松添加这种约束.只需按住控制键,然后将视图拖动到容器,它将显示"顶部空间到顶部布局指南"选项.

但是当我在xib文件中执行相同的操作时,此选项会消失.

那么,有没有办法在xib文件中添加这种约束?或者我是否必须添加代码?
我正在尝试在我的UIRefreshControl上设置tintColor(在iOS 7上构建).我在storyboard中为tableViewController启用了刷新,然后在我的ViewController viewDidLoad方法中,我执行了以下操作:
[self.refreshControl setTintColor:[UIColor redColor]];
Run Code Online (Sandbox Code Playgroud)
所以现在,当我拉动刷新时,刷新控件的颜色确实是红色的:

我希望我的视图在出现时自动更新,所以我做了:
- (void)viewDidAppear:(BOOL)animated{
[self.refreshControl beginRefreshing];
}
Run Code Online (Sandbox Code Playgroud)
根据/sf/answers/1137547561/,它没有显示纺车,我添加了
[self.tableView setContentOffset:CGPointMake(0, -self.refreshControl.frame.size.height) animated:NO];
Run Code Online (Sandbox Code Playgroud)
强迫表现出来.它显示了它,但现在又回到了默认颜色:

如果我之后尝试手动拉动以刷新,则为红色.
我尝试在iOS6上构建它并且它可以正常工作,这是一个iOS7错误吗?
PS:这不是模拟器的问题,我尝试在设备上构建它,同样的bug.
PPS:我构建了一个示例项目,你能告诉我你是否有相同的bug或我的代码中是否有问题?这是链接:http://d.pr/f/pGrV
非常感谢 !
我通过组织者将应用程序提交到Apps商店时收到此警告.
该应用程序引用Payload/.app /:解码器中的非公共选择器
我知道如果我们在应用程序中使用任何第三方API,我们会收到此警告.我在应用程序中使用了SOCKETIO-ObjC库来实现聊天功能.还使用facebook iOS sdk进行fb实现.所以我没有得到确切原因导致此警告.请找到附带的ScreenShot以便更好地理解
我们看到iOS 7中Safari的高度为100%的Web应用程序存在问题.似乎window.innerHeight(672px)与window.outerHeight(692px)不匹配,但仅在横向模式下.最终发生的事情是,在身体高度为100%的应用程序中,您可以获得20px的额外空间.这意味着当用户在我们的应用上滑动时,导航元素会被拉到浏览器镶边后面.这也意味着位于屏幕底部的任何绝对定位的元素最终都会关闭20px.
这个问题也在这里提出了这个问题: IOS 7 - css - html height - 100%= 692px
在这个模棱两可的截图中可以看到:

我们要做的就是解决这个问题,以便在Apple修复bug之前,我们不必担心它.
这样做的一种方法是绝对仅在iOS 7中定位主体,但这几乎将额外的20px放在页面的顶部而不是底部:
body {
position: absolute;
bottom: 0;
height: 672px !important;
}
Run Code Online (Sandbox Code Playgroud)
任何帮助强迫outerHeight匹配innerHeight,或者黑客攻击以便我们的用户看不到这个问题的任何帮助都将非常感激.
当使用Podfile用Xcode5开发iOS 7应用程序时,我们总是遇到这个问题.
经过一番搜索,似乎没有CocoaPods的最终解决方案?当你看到这个时,也许就解决了.
现在如何解决这些问题?
问题是:Pods作为'libPods.a'的隐式依赖被拒绝,因为它的架构'armv7 armv7s'不包含所有必需的架构'armv7 armv7s arm64'
如何在iOS7中更改UISearchBar的背景颜色?

不是灰色,我想像我的uinavigationbar一样改变颜色
如果我使用此代码,那就是出来的
searchBar.backgroundColor = [UIColor redColor];
Run Code Online (Sandbox Code Playgroud)

那不是红色!!! 这与导航栏的背景颜色完全相同.
objective-c background-color uisearchbar uisearchdisplaycontroller ios7
我正在使用AutoLayout在iPad应用程序上工作,如果用户启用某种模式("抬头"模式),我想只支持纵向(或纵向颠倒)方向,此外,如果设备在风景,我想自动切换到纵向模式.
在顶视图控制器中,我有以下内容:
- (NSUInteger) supportedInterfaceOrientations {
if (self.modeHeadsUp) {
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
} else {
return UIInterfaceOrientationMaskAll;
}
}
- (BOOL) shouldAutorotate {
return TRUE;
}
Run Code Online (Sandbox Code Playgroud)
基于我在其他地方看到的答案,答案似乎是我应该使用"application setStatusBarOrientation".因此,在用户选择"抬头"模式的方法中,我包括:
UIApplication *application = [UIApplication sharedApplication];
[application setStatusBarOrientation:UIInterfaceOrientationPortrait
animated:YES];
Run Code Online (Sandbox Code Playgroud)
但是,这根本就没有做任何事情.虽然我可以物理移动设备以使其旋转为纵向,但它不会自动移动.
实际上,在运行上面的代码后尝试以横向模式尝试以编程方式设置方向时,当我使用以下代码查询应用程序"statusBarOrientation"时,它对于横向保持为"4":
UIApplication *application = [UIApplication sharedApplication];
int orientation = [application statusBarOrientation];
self.movesTextView.text = [NSString stringWithFormat:@"ORIENTATION %d", orientation];
Run Code Online (Sandbox Code Playgroud)
好像autolayout可能没有被setStatusBarOrientation触发,所以我试图在之后添加这个代码,没有效果:
[super updateViewConstraints];
[self.view updateConstraints];
Run Code Online (Sandbox Code Playgroud)
我意识到Apple希望将设备方向放在用户手中.但是,我希望能够在不进行"抬头"模式时支持横向模式.
我错过了能够强制改变方向的东西吗?
如何在iOS 7中为我的半透明导航栏获得正确的颜色?导航栏只是将给定的颜色调整为更亮的颜色.改变颜色的亮度或饱和度也无法提供正确的结果.
谁有同样的麻烦?它似乎以某种方式工作,看着Facebook:他们有自己的颜色和半透明的导航栏.
编辑:只是为了说清楚:我需要条形图是半透明的,不透明(有一些阿尔法),不是坚实的!http://en.wikipedia.org/wiki/Transparency_and_translucency
编辑:现在发布到Apple BugReporter
我刚刚将我的iPhone 4S软件更新到iOS 7 Beta 2,而我正在最后接触到一个新的应用程序(Phonegap)..不是一个好主意!
完成后,Xcode没有检测到我的iPhone,所以我安装了Xcode 5 beta.在摆弄它之后我终于得到它来检测我的手机.现在唯一的问题是使用的架构存在错误.
以下是产生的错误:
ld: warning: ignoring file /Users/-----------/Library/Developer/Xcode/DerivedData/testtest-bmnbmujiosugcmgeiceofgcfmsec/Build/Products/Debug-iphoneos/libCordova.a, file was built for archive which is not the architecture being linked (armv7s): /Users/--------/Library/Developer/Xcode/DerivedData/testtest-bmnbmujiosugcmgeiceofgcfmsec/Build/Products/Debug-iphoneos/libCordova.a
Undefined symbols for architecture armv7s:
"_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o
"_CDVLocalNotification", referenced from:
-[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
"_OBJC_CLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_CLASS_$_MainCommandDelegate in MainViewController.o
"_OBJC_CLASS_$_CDVCommandQueue", referenced from:
_OBJC_CLASS_$_MainCommandQueue in MainViewController.o
"_OBJC_METACLASS_$_CDVViewController", referenced from:
_OBJC_METACLASS_$_MainViewController in MainViewController.o
"_OBJC_METACLASS_$_CDVCommandQueue", referenced from:
_OBJC_METACLASS_$_MainCommandQueue in MainViewController.o
"_CDVPluginHandleOpenURLNotification", referenced from:
-[AppDelegate application:handleOpenURL:] in AppDelegate.o
"_OBJC_CLASS_$_CDVViewController", referenced from: …Run Code Online (Sandbox Code Playgroud) 我有一个UIPageViewController半透明的状态栏和导航栏.topLayoutGuide正如预期的那样,它是64像素.
但是,UIPageViewController报告的子视图控制器为topLayoutGuide0像素,即使它们显示在状态栏和导航栏下.
这是预期的行为吗?如果是这样,在真实情况下定位子视图控制器视图的最佳方法是topLayoutGuide什么?
(缺少使用parentViewController.topLayoutGuide,我认为是黑客攻击)
ios7 ×10
ios ×4
xcode5 ×4
objective-c ×3
xcode ×3
autolayout ×2
arm64 ×1
autorotate ×1
cocoapods ×1
colors ×1
cordova ×1
css ×1
ipad ×1
iphone ×1
safari ×1
socket.io ×1
uisearchbar ×1