简体   繁体   中英

how can i set a color for my navigation controller buttons?

How can i add a specific color to my navigation controller background? All i can seem to find is how to set a specific image, but for my need, i only require a background color. Is there a way or is there no SDK-integrated way to change only the color?

Are you saying the navigationbar color

[navController.navigationBar setTintColor:[UIColor someColor]];

You can not set background color on UINavigationController. The navigation controller is NOT an UIView!

The UINavigationController class implements a specialized view controller that manages the navigation of hierarchical content. This class is not intended for subclassing. Instead, you use instances of it as-is in situations where you want your application's user interface to reflect the hierarchical nature of your content. This navigation interface makes it possible to present your data efficiently and also makes it easier for the user to navigate that content.

UINavigationController Class Reference

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM