2016-08-11 47 views
0

我需要隱藏與Cart隱藏回來的TabBar導航控制按鈕

enter image description here

編輯重疊1 我已經添加了這些東西

override func viewWillAppear(animated: Bool) { 
     super.viewDidAppear(animated) 
     self.tabBarController!.navigationItem.title = "Orders" 
     // self.navigationItem.rightBarButtonItem = UIBarButtonItem(title:"Cart", style: UIBarButtonItemStyle.Plain, target: self, action: nil) 
     self.tabBarController!.navigationItem.rightBarButtonItem = UIBarButtonItem(title:"Cart", style: UIBarButtonItemStyle.Plain, target: self, action: nil) 
     self.tabBarController!.navigationItem.leftBarButtonItem = UIBarButtonItem(title:"Cart", style: UIBarButtonItemStyle.Plain, target: self, action: nil) 
     self.navigationItem.hidesBackButton = true 
    } 


    override func viewDidLoad() { 
     super.viewDidLoad() 
     self.tabBarController!.navigationItem.title = "Orders" 
     self.navigationItem.title = "Order History" 
    // self.navigationItem.rightBarButtonItem = UIBarButtonItem(title:"Cart", style: UIBarButtonItemStyle.Plain, target: self, action: nil) 
     self.tabBarController!.navigationItem.rightBarButtonItem = UIBarButtonItem(title:"Cart", style: UIBarButtonItemStyle.Plain, target: self, action: nil) 
     self.tabBarController!.navigationItem.leftBarButtonItem = UIBarButtonItem(title:"Cart", style: UIBarButtonItemStyle.Plain, target: self, action: nil) 
     // Do any additional setup after loading the view. 
     self.navigationItem.hidesBackButton = true 
} 

回答

0
Back

在這個地方

self.navigationItem.hidesBackButton = true 

嘗試這種

self.navigationItem.leftBarButtonItem = UIBarButtonItem(customView: UIView()) 

選項-2

self.tabbarcontroller.navigationcontroller.navigationitem.hidesBackButton = true 
self.tabBarController!.navigationItem.rightBarButtonItem = UIBarButtonItem(title:"Cart", style: UIBarButtonItemStyle.Plain, target: self, action: nil) 
self.tabBarController!.navigationItem.leftBarButtonItem = UIBarButtonItem(title:"Cart", style: UIBarButtonItemStyle.Plain, target: self, action: nil) 
+0

它因此未於事無補 – onkar

+0

@onkar - 嘗試選項-2回答 –

0
self.navigationItem.hidesBackButton = YES; 
+0

請編輯 – onkar

0

與嘗試下面的代碼,寫視圖控制器對這個碼第一navigationcontroller(PushViewController)之後出現。

self.navigationItem.setHidesBackButton(true, animated: false) 
0
self.tabBarController!.navigationItem.hidesBackButton = true 
相關問題