- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我有一个奇怪的问题。每当我的应用程序启动时,我都会在 AppDelegate 中执行以下操作:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
[[UINavigationBar appearance] setBarTintColor:[UIColor whiteColor]];
[[UINavigationBar appearance] setTintColor:[UIColor mainLightBlue]];
[[UITabBar appearance] setTintColor:[UIColor mainLightBlue]];
[IJContext setDefaultContext:[[IJContext alloc] init]];
RKLogConfigureFromEnvironment();
return YES;
}
然后,如果我的用户成功登录,我将在 AppDelegate 中执行以下操作:
-(void)presentNewsFeed
{
RKLogConfigureByName("RestKit/Network", RKLogLevelDebug);
UIViewController *newTopViewController = [[UIStoryboard storyboardWithName:@"MainiPadStoryboard" bundle:nil] instantiateViewControllerWithIdentifier:@"GlobalInitialSliding"];
[_window setRootViewController:newTopViewController];
}
此时,setTintColor 工作正常。现在,每当用户注销时,我都会调用:
- (void)presentLoginScreen
{
UIViewController *newTopViewController = [[UIStoryboard storyboardWithName:@"MainiPadStoryboard" bundle:nil] instantiateViewControllerWithIdentifier:@"Login"];
[_window setRootViewController:newTopViewController];
}
再次位于 AppDelegate 中。如果重新登录,我会再次调用 presentNewsFeed
。但是,第二次,setTintColor 不再起作用,并且我的所有选项卡在被选中时实际上都没有 tintColor。所以我的用户实际上不知道选择了哪个选项卡。关于原因有什么想法吗?
最佳答案
我在 viewController
中有另一个 tintColor
声明,它与 appDelegate
中的声明混淆了!
谢谢
关于ios - UITabBar setTintColor 在 [_window setRootViewController] 之后不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21460357/
在我的应用程序中,我根据用户操作以编程方式更改 Root View Controller ,例如登录/注销功能。 在 iOS 8 中 - 我注意到一个奇怪的问题。即使在窗口上设置了 rootViewC
我正在开发一个通用的应用程序。在 iphone 版本中,我使用标准的 UINavigationController 堆栈进行导航,一切都很好。然而,在 ipad 版本中,我对所有内容都使用 UISpl
我正在为 iPhone 做一个计算器,当设备旋转时,会显示一个新 View ,但我收到以下三个错误: CalculatorAppDelegate.m:21: warning: incompatible
manual ( list 5-2)表示可以像这样将 Split View Controller 添加到 UIWindow 中: [window addSubview:splitVC.view]; 但
我有一个奇怪的问题。每当我的应用程序启动时,我都会在 AppDelegate 中执行以下操作: - (BOOL)application:(UIApplication *)application did
我是用 4.0 sdk 开始 iphone 开发的。我正在尝试使我的应用与 3.2 兼容。我意识到 -[UIWindow setRootViewController:] 被添加到 4.0 版的 sdk
我是一名优秀的程序员,十分优秀!