viewDidLoad 中运行下面代码检测应用是否在iphone5上运行。
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
// iPhone Classic
[_backgr setImage:[UIImage imageNamed:@"usefull_i4.png"]];
[scrollView setFrame:CGRectMake(16, 69, 291, 349)];
[_backgr setFrame:CGRectMake(0, 0, 320, 480)];
}
if(result.height == 568)
{
// iPhone 5
[_backgr setImage:[UIImage imageNamed:@"usefull_i5.png"]];
[scrollView setFrame:CGRectMake(15, 111, 295, 349)];
[_backgr setFrame:CGRectMake(0, 0, 320, 568)];
}
}
但是没有运行,如果我将iphone3.5改为iphone4可以运行。
不知道应该怎么解决?
补充:
刚才图片没有加成功
请点击这里:http://i.stack.imgur.com/OzdVU.jpg
在这里将3.5改为4.0。没用Autolayout。