简体   繁体   中英

Customize Tab Bar in AppDelegate iOS

I am trying to customize the Tab Bar in the AppDelegate.m . I found code online to declare the Tab Bar like this:

// Assign tab bar item with titles

UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;

This makes sense if the Tab bar is the root view controller, but it isn't. I get a crash because an Unrecognized selector sent to instance... This makes sense, because the tab bar isnt loaded until I pass the Login View Controller.

How can I style the tab bar in the AppDelegate?

如果Login View Controller是rootViewController ,则有充分的理由在您展示它之前在Login View Controller中配置UITabBarController

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