- How do I change the background color in Uisegmentedcontrol?
- How do I change the text color in segmented control?
- How do I customize segmented control in Swift?
How do I change the background color in Uisegmentedcontrol?
To change the overall color of the segmented control use its backgroundColor . To change the color of the selected segment use selectedSegmentTintColor . To change the color/font of the unselected segment titles, use setTitleTextAttributes with a state of . normal / UIControlStateNormal .
How do I change the text color in segmented control?
tintColor = [UIColor redColor]; for (id segment in [button subviews]) for (id label in [segment subviews]) if ([label isKindOfClass:[UILabel class]]) UILabel *titleLabel = (UILabel *) label; [titleLabel setTextColor:[UIColor blackColor]]; UIBarButtonItem *barButtonItem = [[[UIBarButtonItem alloc] ...
How do I customize segmented control in Swift?
Click on the UIView , go to the identity inspector, and give the custom class the name BetterSegmentedControl for your UIView . Xcode will build your project so wait until the build finishes, then you have a custom segment on your UIView .