简体   繁体   中英

Using custom background color and/or image in more tab from tab bar

I use a custom image in the navbar (although a solid color would be okay). I've added the image to all my views using setBackgroundImage but now when the more view loads it's blue and looks awkwardly different from the rest of the views. How can I set the image or color of the more view and the corresponding configure view? Is there some sort of controller I should make? Thanks!

If you mean how to apply the same image to every navigation bar, then put the following in your app delegates didFinishLaunchingWithOptions method.

[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"MyImageName"] forBarMetrics:UIBarMetricsDefault]; 

EDIT: Place this in the viewDidLoad method of your first view controller:

[[[self.tabBarController moreNavigationController] navigationBar] setBackgroundImage:[UIImage imageNamed:@"myImage"] forBarMetrics:UIBarMetricsDefault];

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