简体   繁体   中英

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.

It´s strange because for iPhone 5 and below works right. I have set a new default "Launch Screen.storyboard" as Launch Screen File and here is what I get:

UIPageViewController not showing at full screen

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.

I checked the PageViewDemo source you provide. You should add this method to your 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. 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:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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