ddeville / DDPageControl

An easily customizable alternative to UIKit's UIPageControl
http://www.ddeville.me
Other
275 stars 68 forks source link

Is it possible to change width of the view? #6

Open olutsenko opened 12 years ago

olutsenko commented 12 years ago

I am trying to change width of the control, to make it as wide as screen width:

DDPageControl *pageControl = [[DDPageControl alloc] init];
pageControl.numberOfPages = 4;
pageControl.currentPage = 0;
pageControl.indicatorDiameter = 5.0;
pageControl.frame = CGRectMake(0.0, 300.0, 320.0, 36.0);

This doesn't work for me, the width always equals to 100.0

How can I change this parameter?

Thanks.

fictorial commented 12 years ago

I just hit this same issue... I want this control to be full-width so tapping on it will paginate prev/next. It's kind of useful to allow that.

My workaround was to remove the - (void)setFrame:(CGRect)aFrame and - (void)setBounds:(CGRect)aBounds in DDPageControl.m

epologee commented 12 years ago

This is the one issue that prevents DDPageControl from being a drop-in replacement. Indeed removing the two setters resolved the issue for me.

WEARE commented 12 years ago

+1 for this. I'm not sure when having the control set it's own width might be useful, but it should be an opt-in anyway to allow for DDPageControl being a drop-in replacement on UIPageControl.

liushuaikobe commented 10 years ago

+1 for this. Are there some solution without changing the code to this issue?