0

I have a UISegment controller,In this controller I want to change the selected segment controller tab color to orange.Other tab will be normal gray color. Please help me how to achieve this.

Friend
  • 7
  • 4
  • 1
    Possible duplicate of http://stackoverflow.com/questions/2270526/uisegmentedcontrol-selected-segment-color http://stackoverflow.com/questions/12103961/change-the-color-of-selected-segment-control – Puneet Sharma Aug 22 '13 at 11:45

1 Answers1

2

Simple way to get this using UISegmentedControl appearance

[[UISegmentedControl appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                         [UIColor orangeColor],UITextAttributeTextColor, nil]
                                               forState:UIControlStateSelected];
Toseef Khilji
  • 17,192
  • 12
  • 80
  • 121
  • Hi viruss,Its working for text is fine,But I want the segment color change instead of blue(default color). – Friend Aug 22 '13 at 12:56