Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the best way of handling a UIPageControl that has so many dots they don't all fit on the screen

I have a UIPageControl in my application that looks perfectly fine with around 10 pages (dots), it's possible however for the user to add many different views, and so the number of dots could become say 30.

When this happens the dots just disappear off the edge of the screen, and you can't always see the currently selected page, making it all look terrible.

Is there any way to make the pagecontrol multi-line, or to shift it left or right at the moment the currently visible page disappears of the screen.

like image 282
BinaryGuy Avatar asked Jan 20 '11 09:01

BinaryGuy


2 Answers

I created an eBook application that used UIScrollView that contained a UIWebView. The book had over 100 pages so UIPageControl could not handle it because of the problem you pointed out. I ended up creating a custom "slider" type view that acted similar to UIPageControl but could handle the large number of pages. That's pretty much what you will need to do. UIPage control cannot handle as many pages as you want...

like image 126
Vic320 Avatar answered Nov 15 '22 14:11

Vic320


Calculate the pages/dot ratio and store as float value. Then calculate current dot number as current page/pagesPerDot. You may need to advance a few pages before seeing the dot move, but it's very scalable and works well.

like image 40
UserNYC Avatar answered Nov 15 '22 16:11

UserNYC