I need to set custom colors to my UINavigationBar buttons. I do the following (the RGB function is the definition):
- (void)viewWillAppear:(BOOL)animated
{
for (UIView *view in self.navigationController.navigationBar.subviews)
if ([[[view class] description] isEqualToString:@"UINavigationButton"])
[(UINavigationButton *)view setTintColor:RGB(22.0,38.0,111.0)];
}
Everything looks fine when the application loads. after exiting the view and returning the color, it returns to default.
Secondly, I need to configure the same color on the UISegmentedControl with the button I clicked.
source
share