欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

判断用户界面是ipad的还是phone的代码 博客分类: IOS ipadiphone界面判断 

程序员文章站 2024-02-04 15:35:16
...
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
	NSString *nibTitle = @"PadContent";
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
	{
		nibTitle = @"PhoneContent";
    }
    [[NSBundle mainBundle] loadNibNamed:nibTitle owner:self options:nil];
    
    [self.window addSubview:self.contentController.view];
	[window makeKeyAndVisible];
}