Change UISegmentControl color in iOS
How to change color of UISegmentControl in iOS ?
To change UISegmentController color add the following code in your viewDidLoad :
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - Color segments | |
UIColor *selectedColor = [UIColor colorWithRed: 110.0f/255.0 green:195.0f/255.0 blue:132.0f/255.0 alpha:1.0]; | |
for (id subview in [self.segmentControl subviews]) { | |
[subview setTintColor:selectedColor]; | |
} |
Result
Cheers !
Happy Coding :)
Thanks for this beautiful post IOS. It is really good for the beginners and I also liked the post.
ReplyDeleteIOS Training in Bangalore
IOS Training in Marathahalli