這是美工給的tabbar圖

所以我們需要自定義一個按鈕放在中間位置。這個按鈕我們放在 TabBarController.view 上。
當我們進行push跳轉(zhuǎn)時需要隱藏掉tabbar。
1.在跳轉(zhuǎn)后界面隱藏
-(void)viewWillAppear:(BOOL)animated{
? ? ? ?[superviewWillAppear:YES];
? ? ? ?self.tabBarController.tabBar.hidden=YES;
}
2.在push跳轉(zhuǎn)時需要隱藏tabBar,設(shè)置
VC(需要跳轉(zhuǎn)的VC).hidesBottomBarWhenPushed=YES;
ps:第二種方法會出現(xiàn)某種問題,假如跳轉(zhuǎn)順序A-->B-->C-->,當A-->B隱藏掉了tabbar,B后面所有的界面tabbar都會被隱藏掉。
那么問題來了?!
當我們push跳轉(zhuǎn)時可以隱藏掉tabbar,但是這個按鈕卻隱藏不掉,因為他寫在了TabBarController上。所以就會出現(xiàn)這種情況

所以我們需要把tabbarcontorller設(shè)置成appdelegate的一個屬性,這樣隨便在哪個頁面都可以得到了
在tabbarcontorller.m中加入
-(void)setHidesBottomBarWhenPushed:(BOOL)hidesBottomBarWhenPushed{
? ? ? ? ?self.homeButton.hidden(自己定義的按鈕)= hidesBottomBarWhenPushed;
}
跳轉(zhuǎn)后的界面viewWillAppear加入
self.tabBarController.hidesBottomBarWhenPushed=YES;