大家好我正在使用有三個選項卡的標籤欄控制器以及出導航抽屜幻燈片的應用程序。我的問題是如何在左上角放置一個酒吧按鈕項目。它不顯示我什麼時候運行我的應用程序,但它顯示在常規視圖控制器中。這裏是我的代碼。如何菜單按鈕添加到標籤欄控制器
#import "FirstViewController.h"
#import "SWRevealViewController.h"
@interface FirstViewController()
@end
@implementation FirstViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[[UITabBar appearance] setTintColor:[UIColor redColor]];
[self.tabBarController setTitle:@"News"];
// Change button color
_sidebarButton.tintColor = [UIColor colorWithWhite:0.1f alpha:0.9f];
// Set the side bar button action. When it's tapped, it'll show up the sidebar.
_sidebarButton.target = self.revealViewController;
_sidebarButton.action = @selector(revealToggle:);
// Set the gesture
[self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
添加導航欄。 –
@Vineesh TP如何將導航欄添加到我的firstView控制器,它是沒有它的最上面一欄的後面 – user3381665