У меня проблемы с UISegmentedControl, чтобы показать желаемый цвет оттенка.UISegmentedControl tintColor
// AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// need red tint color in other views of the app
[[UIView appearance] setTintColor:[UIColor redColor]];
return YES;
}
// ViewController
- (void)viewDidLoad {
[super viewDidLoad];
NSArray *items = @[@"Item 1", @"Item 2"];
UISegmentedControl *control = [[UISegmentedControl alloc] initWithItems:items];
// would like to have this control to have a green tint color
control.tintColor = [UIColor greenColor];
[self.view addSubview:control];
}
Как сделать UISegmentedControl использовать зеленый оттенок?
Вы пробовали это: '[[UISegmentedControl внешний вид] setTintColor: [UIColor greenColor]];' – BoilingLime
Да, печально производит тот же результат. –
Не очень лучший способ сделать это, но может работать. попробуйте установить цвет для каждого подзаголовка 'UISegmentControl'? – BoilingLime