DDPageControl icon indicating copy to clipboard operation
DDPageControl copied to clipboard

Is it possible to change width of the view?

Open olutsenko opened this issue 12 years ago • 4 comments

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.

olutsenko avatar May 18 '12 14:05 olutsenko

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

fictorial avatar Jun 01 '12 04:06 fictorial

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

epologee avatar Jun 21 '12 14:06 epologee

+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.

WEARE avatar Jul 16 '12 17:07 WEARE

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

liushuaikobe avatar Aug 21 '14 07:08 liushuaikobe