Change color on UISegmentedControl
Hi,
I want to change the selected segment control color to black and unselected segment to grey. I used tintColor property but it is not doing any changes and I still see the color as default blue.Any inputs how to change it:
CGRect frame = CGRectMake( 10,30,300,40);
segmentedControl.frame = frame;
segmentedControl.segmentedControlStyle = UISegmentedControlStylePlain;
segmentedControl.selectedSegmentIndex = selectedAttributeIndex;
segmentedControl.backgroundColor=[UIColor clearColor];
[segmentedControl setTintColor:UIColor darkGrayColor];
Thanks.
|