Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set background color for UIPageViewController?

How to set color for background view in UIPageViewController? Is it possible to do this in Storyboard?

enter image description here

like image 501
Bartłomiej Semańczyk Avatar asked Aug 03 '15 22:08

Bartłomiej Semańczyk


2 Answers

edit: I thought the question was about UIPageControl.

You should be able to simply modify the color of the UIPageViewController's view:

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor blueColor]; //Set to any color.
}
like image 122
AmsalK Avatar answered Sep 22 '22 20:09

AmsalK


Inside UIPageViewController's view, you can use this code:

override func viewDidLoad() {
    super.viewDidLoad()

    // Set backbround color to white
    self.view.backgroundColor = UIColor.white
}

I've set the color to white, but you can pretty much insert whatever color you want.

Cheers!

like image 24
Guilherme Crozariol Avatar answered Sep 22 '22 20:09

Guilherme Crozariol