【发布时间】:2016-08-25 20:05:56
【问题描述】:
我在didFinishLaunching 的appDel.m 中设置了以下代码。 我目前有 2 个故事板 iPhone 5 和 iPhone 6。问题是我使用的代码没有选择 iPhone 5 故事板,它始终默认为 iPhone 6。
UIStoryboard *storyBd;
CGSize result = [[UIScreen mainScreen]bounds].size;
CGFloat scale = [UIScreen mainScreen].scale;
result = CGSizeMake(result.width, result.height * scale);
NSLog(@"The Result height is %f",result.height);
if (result.height == 1136) {
storyBd = [UIStoryboard storyboardWithName:@"i5Story" bundle:nil];
UIViewController *initView = [storyBd instantiateInitialViewController];
[self.window setRootViewController:initView];
}else if (result.height == 1334){
storyBd = [UIStoryboard storyboardWithName:@"i6Story" bundle:nil];
UIViewController *initView = [storyBd instantiateInitialViewController];
[self.window setRootViewController:initView];
}
【问题讨论】:
-
result.height的日志输出是什么?
标签: ios objective-c storyboard