2

In my application I want to change pagecontrol selectable page (dot) color to brown instead of white.

I know it's possible to change the background color of pagecontrol. But how can I change the selectable page (dot) color to some other color?

UncleZeiv
  • 18,272
  • 7
  • 49
  • 77
kanmani
  • 671
  • 1
  • 10
  • 28
  • See this similar SO question answered [here](http://stackoverflow.com/questions/2942636/how-i-change-the-color-of-pagination-dots-of-uipagecontrol/4073602#4073602) – WrightsCS Jan 06 '11 at 06:23

1 Answers1

2

UIPageControl does not support this by default. You have to create your own page control and do the drawing on your own.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
  • ok.I'm very new to pagecontrol.I don't know how to create own page control..please give me solution to do this.. – kanmani Jan 06 '11 at 07:10
  • could you please help me out to do this...Thank You – kanmani Jan 06 '11 at 07:47
  • hi iphonecool - as boldclock said, its not possible and you have to do it yourself - as in programatically creating the dots that resemble the pagecontrol and mimic the behaviour of pagecontrol. Off the top of my head - create 2 images for on and off; programatically arrange them to make them look like a pagecontrol – Veeru Jan 06 '11 at 10:41
  • @Veeru:I can't get u...please give some sample code...please...please.How to create dots like page control and how to make it works...please help me Veeru... – kanmani Jan 06 '11 at 10:49
  • Never mind, i saw answer posted by Wrights after i posted my comment, follow his link - try to run the code provided in the link, see what error it is, if possible post the error here, we guys will try to help you out. That would be definitely easy for you than to start it from scratch! – Veeru Jan 06 '11 at 10:53
  • ok...please give me a link...i will try understand and do it...Thank You for your fast reply...please consider it's my urgent task...Once again i thank you Veeru... – kanmani Jan 06 '11 at 11:01
  • Hai Veeru...It shows three errors.1'st ERR:Line:CGRect currentBounds = self.bounds; Error:requst for member 'bounds' in something not a structure or union Method:-(void)drawRect: 2nd Err: same error with same line in touchesBegan method. 3rd Err:@protocol PageControlDelegate @optional - (void)pageControlPageDidChange:(PageControl *)pageControl; @end Error:Expected ')' before 'PageControl' – kanmani Jan 06 '11 at 11:39
  • You should probably post another question with these errors instead. – BoltClock Jan 06 '11 at 11:41
  • @BoltClock:I posted new question for change pagecontrol indicator color with the errors that are coming for me in the link provided by Wrights...please help me out to do this Thank You... – kanmani Jan 06 '11 at 12:44
  • @iphonecool - i can't do anything right now, may be tomorrow i will do a test and let you know – Veeru Jan 09 '11 at 03:38