在我的應用程序中,我必須使用標籤欄。但問題是我的第一個視圖是homeviewcontroller,它不包含標籤欄或標籤欄controller.now當點擊登錄時去第一個視圖控制器,它包含標籤欄。標籤欄項目圖像不會隨着故事板的使用而改變
我正在使用故事板,當我拖放標籤欄項導航到導航控制器標籤欄項目圖像不顯示我是新的故事板。當我運行我的應用程序時,它會轉到第一個視圖控制器,但tabbar項目不會更改。
這裏是我的代碼:
在homeviewcontroller.m
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"sign"])
{
[((AppDelegate *)[[UIApplication sharedApplication]delegate]) configure];
NSLog(@"ok");
}
}
在appdelegate.m
-(void)configure
{
NSLog(@"Call Tabbarcontroller");
_tabBarController = (UITabBarController *)self.window.rootViewController;
UIViewController* vc = [_tabBarController.viewControllers objectAtIndex: 0];
vc.tabBarItem = [[UITabBarItem alloc] initWithTitle: @"title" image:[UIImage imageNamed:@"home.png"] tag:0];
}
http://stackoverflow.com/questions/18894985/uitabbar-not-showing-selected-item-images-in- ios-7 – Rushabh