我使用这两个设备,使我的application.my应用程序完美运行在iPad中,但是当我选择设备作为iPhone 4inch有一个错误发生interface.below是图片。 您可以在顶部和底部看到黑色,它来自哪里?做一个应用程序,这是兼容的iphone和ipad
这里是我的代码:
在应用委托:
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
if([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad)
{
NSLog(@"Ipad ");
[application setStatusBarStyle:UIStatusBarStyleLightContent];
self.window.clipsToBounds =YES;
self.window.frame = CGRectMake(0,-20,self.window.frame.size.width,self.window.frame.size.height+20);
}
if
(IS_IPHONE_5)
{
NSLog(@"Iphone %f ",[[UIScreen mainScreen] bounds].size.height);
if ([[UIScreen mainScreen] bounds].size.height == 568) {
[application setStatusBarStyle:UIStatusBarStyleLightContent];
self.window.clipsToBounds =YES;
self.window.frame = CGRectMake(0,-20,self.window.frame.size.width,self.window.frame.size.height+20);
}
}
}
我想,你在iPhone 5设备上运行?对? – Mani
@iMani yes right ..... – user3218052