Mam problemy z pobieraniem UISegmentedControl, aby pokazać żądany kolor tinty.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];
}
Jak zrobić UISegmentedControl używać zielony odcień?
Próbowałeś tego: '[[UISegmentedControl wygląd] setTintColor: [UIColor greenColor]];' – BoilingLime
Tak, Niestety daje taki sam wynik. –
Nie jest to najlepszy sposób na zrobienie tego, ale może działać. spróbuj ustawić kolor dla każdego subviews "UISegmentControl"? – BoilingLime