Why can't I customize the color cast for the UINavigationBar?

I want to change the color in the navigation bar, and the documentation says that you are not trying to change the alpha value. So, how can I set a color that is not SDK-defined values ​​(for example, [UIColor redColor], brownColor, etc.), if all the constructors provide an alpha range value? I tried to get the current alpha value, but that didn't help. When I use my own color, this makes the navigation bar look like x-ray (scraggy, black-on-white).

[self.navigationController.navigationBar setTintColor: [UIColor brownColor]];
+3
source share
2 answers

... , , 0..255 (.. HTML), [0.0.. 1.0]. , 0..255 0..1, , . , , .

+5

:

UINavigationController

MyNavigationController *navigationController = [[MyNavigationController alloc] init];
[[navigationController navigationBar] setTintColor:[UIColor redColor]];
0

Source: https://habr.com/ru/post/1742624/


All Articles