我正在尝试:
我已经看过一些教程,但我仍然没有得到它,有人可以输入/显示需要在应用程序委托(delegate)中执行哪些代码来实现这些目标。
谢谢!
在您的应用委托(delegate)中尝试这样的操作:
- (void)applicationDidFinishLaunchingUIApplication *)application {
UIStoryboard *storyboard = nil;
if([[UIDevice currentDevice]userInterfaceIdiom]==UIUserInterfaceIdiomPhone)
{
if ([[UIScreen mainScreen] bounds].size.height == 568.0f)
{
storyboard = [UIStoryboard storyboardWithName"iPhone5s" bundle:nil];
}
else
{
storyboard = [UIStoryboard storyboardWithName"iPhone4" bundle:nil];
}
}
else
{
storyboard = [UIStoryboard storyboardWithName"iPad" bundle:nil];
}
[window setRootViewController:[storyboard instantiateInitialViewController]];
[window makeKeyAndVisible];
}
关于ios - 如何根据设备加载不同的 Storyboard?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22057225/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |