0
votes

I am having some trouble with my segmentcontrol bar. I am trying to make it a gray/black color with this:

segmentControl3.tintColor = [UIColor colorWithRed:0.60 green:0.60 blue:0.60 alpha:1.0];

Under my getSegment action, and that works just fine when I click it. But my problem is that the load color is the standart blue one, and I can't seem to change that anywhere... I have tried to place it under viewDidLoad, but that diden't seen to work. I have read trough the UICatalog example, but in there all is declared in code. Is that the only way to get it right?

Thanks

2

2 Answers

2
votes

You should be able to use tintColor to change the color of your control; try placing it in viewWillAppear:. Also make sure that your outlet is properly set. I use this in several applications.

You can use [UIColor colorWithWhite: 0.6 alpha: 1.0] to save a little code

0
votes

I made the mistake that I referred to the Segmented Control by pointer type and not by an outlet.. Everything is working fine now :) Thanks for all your help, just didn't understand it until now :D