I use the UIPageViewController to display images in full screen. The problem is that the images are not displayed in full screen. Instead, the bottom is the gap between the images and the viewpoints of the page and the top. I have a UIViewController that is added to the UIPageController as a child / child, and that the ViewController has images displayed using ImageView. I am trying to do this in a quick / storyboard.
I change the top panel and the bottom panel to "none" in the storyboard, but this did not work.
Image Preview:

ChildViewControllerCode Code:
class BoatContentViewController: UIViewController { @IBOutlet weak var imageView: UIImageView! @IBOutlet weak var titleLabel: UILabel! var pageIndex: Int! var titleText: String! var imageFile: String! override func viewDidLoad() { super.viewDidLoad() self.imageView.image = UIImage(named: self.imageFile) self.titleLabel.text = self.titleText
Main control screen:
class BoatViewController: UIViewController, UIPageViewControllerDataSource { @IBOutlet weak var loginButton: UIButton! @IBOutlet weak var skipButton: UIButton! var pageViewController: UIPageViewController! var pageTitles: NSArray! var pageImages: NSArray! override func viewDidLoad() { super.viewDidLoad() loginButton.backgroundColor = UIColor.clearColor() loginButton.layer.cornerRadius = 5 loginButton.layer.borderWidth = 1 loginButton.layer.borderColor = UIColor.purpleColor().CGColor skipButton.backgroundColor = UIColor.whiteColor() skipButton.layer.cornerRadius = 5 skipButton.layer.borderWidth = 1 skipButton.layer.borderColor = UIColor.whiteColor().CGColor self.pageTitles = NSArray(objects: "", "", "", "", "") self.pageImages = NSArray(objects: "onboarding1", "onboarding2", "onboarding3", "onboarding4", "onboarding5") self.pageViewController = self.storyboard?.instantiateViewControllerWithIdentifier("BoatPageViewController") as! UIPageViewController self.pageViewController.dataSource = self var startVC = self.viewControllerAtIndex(0) as BoatContentViewController var viewControllers = NSArray(object: startVC) self.pageViewController.setViewControllers(viewControllers as [AnyObject], direction: .Forward, animated: true, completion: nil) self.pageViewController.view.frame = CGRectMake(0, 30, self.view.frame.width, self.view.frame.size.height - 60) self.addChildViewController(self.pageViewController) self.view.addSubview(self.pageViewController.view) self.pageViewController.didMoveToParentViewController(self)
Application Delegate:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. var pageControl = UIPageControl.appearance() pageControl.pageIndicatorTintColor = UIColor.lightGrayColor() pageControl.currentPageIndicatorTintColor = UIColor.blackColor() pageControl.backgroundColor = UIColor.clearColor() return true }
source share