日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

ios 点击出现另外一套tabbar_IOS 点击tabbaritem跳转到一个新界面,且隐藏tabbar

發(fā)布時間:2025/3/8 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ios 点击出现另外一套tabbar_IOS 点击tabbaritem跳转到一个新界面,且隐藏tabbar 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

先自定義一個UITabbarController,用于Storyboard中

再在MyTabbarController中實現(xiàn)protocol

@interface MyTabbarController : UITabBarController

@end再實現(xiàn)代理里面的方法

@implementation MyTabbarController

- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController {

NSLog(@"shouldSelectViewController %@", tabBarController.selectedViewController);

if (viewController.tabBarItem.tag == 100) {

DiaryViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:DIARY_VC_ID];

[((UINavigationController *)tabBarController.selectedViewController) pushViewController:vc animated:YES];

return NO;

}

return YES;

}

- (id)initWithCoder:(NSCoder *)aDecoder {

self = [super initWithCoder:aDecoder];

if (self) {

self.delegate = self;

}

return self;

}

@end在要監(jiān)聽的tabbaritem跳轉(zhuǎn)的viewcontroller中(比如點擊一個item隱藏tabbar,而且有返回按鈕)

則找到該tabbar,我的是父控件的tabbar,所以

- (void)viewWillAppear:(BOOL)animated {

self.parentViewController.tabBarController.tabBar.hidden = YES;

}點擊返回按鈕后回到開始所選中的tabbaritem

- (void)viewWillDisappear:(BOOL)animated {

self.parentViewController.tabBarController.tabBar.hidden = NO;

}

原文:http://blog.csdn.net/fanxiaoxuan1234/article/details/41721635

總結(jié)

以上是生活随笔為你收集整理的ios 点击出现另外一套tabbar_IOS 点击tabbaritem跳转到一个新界面,且隐藏tabbar的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。