2016-05-19 19 views

回答

2

只要把@{NSForegroundColorAttributeName : [UIColor whiteColor]}文本屬性爲UIControlStateSelected狀態

@interface ViewController() 

@property (weak, nonatomic) IBOutlet UISegmentedControl *segmentedControl; 

@end 

@implementation ViewController 

- (void)viewDidAppear:(BOOL)animated{ 
    [super viewDidAppear:animated]; 

    NSDictionary *dict = @{NSForegroundColorAttributeName : [UIColor whiteColor]}; 


    [self.segmentedControl setTitleTextAttributes:dict forState:UIControlStateSelected]; 
} 

@end 
相關問題