简体   繁体   English

在AppDelegate iOS中自定义标签栏

[英]Customize Tab Bar in AppDelegate iOS

I am trying to customize the Tab Bar in the AppDelegate.m . 我正在尝试自定义AppDelegate.mTab Bar I found code online to declare the Tab Bar like this: 我在网上找到代码来声明Tab Bar如下所示:

// 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. 如果Tab栏是根视图控制器,则有意义,但不是。 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. 我崩溃是因为Unrecognized selector sent to instance...一个Unrecognized selector sent to instance...这很有意义,因为在我通过登录视图控制器之前,不会加载选项卡栏。

How can I style the tab bar in the AppDelegate? 如何在AppDelegate中设置标签栏样式?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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