0

I want to set the selected segment text colour as white and it will be in highlighted state.If I select the other segment then the selected segment text colour should be highlighted and it should be in highlighted state until i will select the different segment.Is it possible?I don't want to hightlight the selected segment but i want to hightlight the text colour until i will deselect or select another segment.

user2186457
  • 128
  • 6

3 Answers3

0

use segment.tintColor = [uicolor whitecolor];

it will help.

Kumar KL
  • 15,315
  • 9
  • 38
  • 60
aBilal17
  • 2,974
  • 2
  • 17
  • 23
0

use it, where objectAtIndex:0 is your selected index.

for (UIView *v in [[[segment subviews] objectAtIndex:0] subviews]) {
   if ([v isKindOfClass:[UILabel class]]) {
      UILabel *lable=(UILabel *)[v retain];
      lable.textColor=[UIColor blackColor];
   }
}
aBilal17
  • 2,974
  • 2
  • 17
  • 23
0

The answer in the below link fixed the problem.How to change font color of UISegmentedControl

Community
  • 1
  • 1
user2186457
  • 128
  • 6