我正在使用Xcode 5. 我想要构建一个兼容IOS 6以及IOS 7的UI的应用程序。任何人都可以帮助我与此。应用程序应该与iPhone(3GS)兼容,iPhone的Retina 3.5和iPhone 4的Retina有IOS 6Xcode 5,如何建立一个与IOS 6兼容的应用程序以及IOS 7
我已经尝试启用自动布局时,我看它在iPhone(3GS)
UI失真,但仍然问题仍然存在一些屏幕。
我正在使用Xcode 5. 我想要构建一个兼容IOS 6以及IOS 7的UI的应用程序。任何人都可以帮助我与此。应用程序应该与iPhone(3GS)兼容,iPhone的Retina 3.5和iPhone 4的Retina有IOS 6Xcode 5,如何建立一个与IOS 6兼容的应用程序以及IOS 7
我已经尝试启用自动布局时,我看它在iPhone(3GS)
UI失真,但仍然问题仍然存在一些屏幕。
有几个宏这是有帮助的在这种情况下
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
#define APP_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] compare:v options:NSNumericSearch] != NSOrderedAscending)
看到的是您的iOS版本比iOS7更大:
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) {
// iOS 7 specific instruction
}
然而就是这个IF-ELSE还很长,你可以做这样的事情
#define IS_IOS_7 SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")
然后
if (IS_IOS_7) {
// instruction...
}
1:如果您正在使用的UINavigationController和你的导航栏是可见的话,这个工程
float systemVersion=[[[UIDevice currentDevice]systemVersion]floatValue];
if(systemVersion >=7.0f)
{
self.edgesForExtendedLayout=UIRectEdgeNone;
}
OR 您也可以从stoyboard
2集:另一个解决方案是您可以使用IOS 6/7三角洲
i) take new view and setting its Y postion is 20 ii) move all control into this view iii)setting new view Detas Y Property is -20
您现在查看hirerachy的样子为
可以在follwing图像如何设置三角洲属性看
投票结束为**展示最小的理解**也不难对谷歌并找到https://developer.apple.com/library/ios/documentation/userexperience/conceptual/TransitionGuide/一点点的研究有很长的路要读http://meta.stackexchange.com/questions/182266 /如何-多的研究,努力-是 - 预期的的堆栈溢出用户/ 182380#182380 – Popeye