Xcode 4 UIPage Control: How to change the height of the Page Control?
I wanted to make the UIPageControl area (dots) shorter. I tried to change its height smaller in the Size Inspector but its height value is greyed ou开发者_JS百科t and it cant be changed. It's value by default is 36. Is there any way of decreasing this value programmatically? I know that you can make the page controllers background see through, but I don't want that. I wanted to make the background slightly transparent, I did that, but I want the Height of the background to be smaller. If someone can help me out then that would be awesome. THANKS!
This is how you change the height of a UIPageControl. In the PageViewController.m in the viewDidLoad method, put the following code:
self.pageViewController.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 100);
This updates the frame property of the view of your UIPageControl.
Try this:
CGRect frame = pageControl.frame;
frame.size.height = 10.0; // or whatever you want
pageControl.frame = frame;
This, of course, goes in your code, presumably in the controller that has access to your pageControl IBOutlet.
精彩评论