문제

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.

도움이 되었습니까?

해결책

Simple way to get this using UISegmentedControl appearance

[[UISegmentedControl appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                         [UIColor orangeColor],UITextAttributeTextColor, nil]
                                               forState:UIControlStateSelected];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top