// Init Page Control
UIPageControl *pageControl = [[UIPageControl alloc] init];
pageControl.frame = CGRectMake(110,5,100,100);
pageControl.numberOfPages = 2;
pageControl.currentPage = 0;
[self.view addSubview:pageControl];
I'm trying to create UIPageControl programmatically. I created new view based app. In which, i have written this code in ViewControllers viewDidLoad, but its not creating page control. When i see in console viewdidload is called many times.
LMAO with this one cause I just had the same problem :) if you still got this problem or any one else will struggle with this try setting background colour simply like
pageControl.backgroundColor = [UIColor redColor];
the funny thing is that page controls' default colour settings make it difficult to notice on i.e. clear white view :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With