简体   繁体   English

iOS 9未全屏显示UIPageViewController

[英]iOS 9 not showing UIPageViewController full screen

I´m updating and app that it was built using iOS 8 and Xcode 6 to iOS 9 and Xcode 7. The app was working perfectly but now it is not showing my UIPageViewController at full screen in iPhone 6 and iPhone 6s. 我正在更新和应用程序,它是使用iOS 8和Xcode 6到iOS 9和Xcode 7构建的。该应用程序运行正常,但现在在iPhone 6和iPhone 6s中没有全屏显示我的UIPageViewController。

It´s strange because for iPhone 5 and below works right. 这很奇怪,因为适用于iPhone 5和更低版本的iPhone正常工作。 I have set a new default "Launch Screen.storyboard" as Launch Screen File and here is what I get: 我将新的默认“启动Screen.storyboard”设置为启动屏幕文件,这是我得到的:

UIPageViewController not showing at full screen UIPageViewController没有全屏显示

I have found a similar question here but it seems that there are no right answers. 我在这里找到了类似的问题但似乎没有正确的答案。

I followed a tutorial from www.appcoda.com to make my UIPageViewController and using the code from there https://dl.dropboxusercontent.com/u/2857188/PageViewDemo.zip I'm not able to make it work in iPhone 6 and iPhone 6s. 我遵循了来自www.appcoda.com的教程来制作我的UIPageViewController,并使用那里的代码https://dl.dropboxusercontent.com/u/2857188​​/PageViewDemo.zip我无法使其在iPhone 6和iPhone 6s。

I checked the PageViewDemo source you provide. 我检查了您提供的PageViewDemo源。 You should add this method to your ViewController.m 您应该将此方法添加到您的ViewController.m

- (void)viewDidLayoutSubviews {
   [super viewDidLayoutSubviews];
   self.pageViewController.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 30);
}

Hope this helps. 希望这可以帮助。

When you add the new LauncScreen.storyboard, you are indicating to the OS that you are supporting iPhone6/6+ native resolutions. 当添加新的LauncScreen.storyboard时,向操作系统表明您正在支持iPhone6 / 6 +本机分辨率。 Check if you are missing autolayout constraints. 检查是否缺少自动布局约束。 Refer this article on how to go about it. 请参阅文章对如何去做。

[UPDATED]: [更新]:

Add constraints to Page Content View Controller as shown below: 向页面内容视图控制器添加约束,如下所示: 在此处输入图片说明

Add launch screen file: 添加启动屏幕文件: 在此处输入图片说明

Select launch screen file in Target>General: 在“目标”>“常规”中选择启动屏幕文件: 在此处输入图片说明

Enjoy the results: 享受结果:

在此处输入图片说明

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

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