Change UISegmentControl color in iOS

How to change color of UISegmentControl in iOS  ?






 To change UISegmentController color add the following code in your viewDidLoad  : 


#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];
}
view raw gistfile1.txt hosted with ❤ by GitHub



Result





Cheers !

Happy Coding :)

Comments

  1. Thanks for this beautiful post IOS. It is really good for the beginners and I also liked the post.
    IOS Training in Bangalore
    IOS Training in Marathahalli

    ReplyDelete

Post a Comment

Popular Posts