不工作我有一個奇怪的問題。每當我的應用程序啓動,我不中的AppDelegate如下:UITabBar setTintColor後[_window setRootViewController]
- (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。所以我的用戶實際上不知道選擇了哪個選項卡。任何想法爲什麼?
然後接受這個答案。 – Pawan