开发者

how to change the color/style of the toolbar that comes with the UInavigationBar?

开发者 https://www.devze.com 2023-03-15 06:31 出处:网络
I want to change the colour of the toolbar to Black from the default blue. How do I do that 开发者_StackOverflow? Thanks.You need to set the barStyle on the UINavigationBar to UIBarStyleBlack:

I want to change the colour of the toolbar to Black from the default blue. How do I do that 开发者_StackOverflow? Thanks.


You need to set the barStyle on the UINavigationBar to UIBarStyleBlack:

navigationController.navigationBar.barStyle = UIBarStyleBlack;

If you need to set it to some other color, you will need to set the tintColor property:

navigationController.navigationBar.tintColor = [UIColor blackColor];

You can read this question if you interested in the benefits of UIBarStyleBlack over a [UIColor blackColor] tintColor.


Use the below code. You can change the color of navigationbar what ever you want. Here I'm using brown , instead of this you can specify another color.

self.navigationController.navigationBar.tintColor = [UIColor brownColor]; 


I believe you're looking for setTintColor

0

精彩评论

暂无评论...
验证码 换一张
取 消