繁体   English   中英

iPhone应用程序在iPad中已经延伸

[英]iPhone app has stretched in the iPad

我想在iPad上测试iPhone应用程序,但我现在只有iPad。 IOS5.1和Xcode 4.3.1是我的环境,我在项目TARGETS中设置了相同的故事板,在iPad上运行的应用程序已经全屏显示(所有的UILayouts都已拉伸),无法显示任何视图切换应用程序。

如何在iPad上运行相同尺寸的应用程序?

您需要将应用目标从Universal更改为iPhone。

转到[Project Targets]>摘要> iOS Application Target> Devices> iPhone

通过这种方式,iPad将作为传统iPhone应用程序打开您的应用程序。

不知道如何使用故事板,但使用普通的UIViewControllers你会有iphone / ipad的单独xib文件,并检查哪一个加载如下:

  if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        self.motionJpegViewController = [[MotionJpegViewController alloc] initWithNibName:@"MotionJpegViewController_iPhone" bundle:nil];
    } else {
        self.motionJpegViewController = [[MotionJpegViewController alloc] initWithNibName:@"MotionJpegViewController_iPad" bundle:nil];
    }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM