如何以编程方式设置iOS 6/7 Deltas [英] how to set iOS 6/7 Deltas programmatically
问题描述
当我离开iOS6时,我正在开发一个使用Xcode 4.6的UISplitView应用程序:
I was developing a UISplitView app by using Xcode 4.6 when I left iOS6 I had design:
现在我迁移到新的Xcode5,现在我有了这个设计:
Now I migrate to new Xcode5 and now I have this design:
UINavigationBar完全重叠我的UISearchBar ...
UINavigationBar overlaps completelly my UISearchBar...
Leo Natan告诉我使用iOS 6/7 Deltas,但因为我正在以编程方式创建和添加我的UISplitViewControllers ,
Leo Natan told me about using a iOS 6/7 Deltas but since I'm creating and adding my UISplitViewControllers programmatically,
这可能不起作用我需要以编程方式设置iOS 6/7,但我不知道如何,任何帮助我都会感激
this may doesn't work I need to set the iOS 6/7 programmatically but I don't know how, any help I'll appreciate
推荐答案
在iOS 7中,现在有扩展的边缘,这就是导航栏覆盖搜索栏的原因。您可以设置 self.edgesForExtendedLayout = UIRectEdgeNone;
这是UIVewControlelr属性。
您还可以根据iOS版本进行检查,您可以根据设备中当前版本的iOS进行检查。
In iOS 7 there are now extended edges, and that's why navigation bar overlaping the searchbar. You can set self.edgesForExtendedLayout = UIRectEdgeNone;
this is UIVewControlelr property.
You can also make checks depending on version of iOS and You can do things depending on current version of iOS in device.
NSString *version = [[UIDevice currentDevice] systemVersion];
int ver = [version intValue];
if (ver < 7){
//iOS 6 work
}
else{
//iOS 7 related work
}
这篇关于如何以编程方式设置iOS 6/7 Deltas的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!