【IOS开发基础系列】UITabBarController专题

重点参考链接:

iOS使用push隐藏子页面底部bottomTabBar

http://blog.csdn.net/wuwo333/article/details/40860047


1 开发技巧

1.1 开发问题

1.1.1 在Storyboard中添加TabBarController后,UITabBarControllerDelegate没有回调

        这是因为没有指定Delegate回调,而在Storyboard中又没法连线指定,必须在代码中指定。

- (void) viewDidLoad {

    [super viewDidLoad];

    // Do any additional setup after loading the view.

    self.delegate = self;

}


1.1.2 TabController加导航条布局架构下,Tabbar的隐藏与显示设置

        Tabbar的隐藏函数,其实只在Nav Push的之前调用时起作用。

    //隐藏Tabbar

    [viewController setHidesBottomBarWhenPushed: YES];

    _isGoBack = false;

    [super pushViewController: viewController animated: animated];


    而Tabbar的显示,则只有在Pop函数调用前执行才真正起作用。

    //显示Tabbar

    if ([viewController isKindOfClass: [RootVC class]]) {

        [viewController setHidesBottomBarWhenPushed: NO];

    }

    return [super popToViewController: viewController animated: animated];


1.1.3 去除TabBar背景图片默认加蓝效果

    UIImage *selectImg = [UIImage imageNamed: @"MySettingIcon"];

    //声明这张图片用原图(别渲染),默认有亮蓝色渲染

    selectImg = [selectImg imageWithRenderingMode: UIImageRenderingModeAlwaysOriginal];

    [self.mySettingTabBarItem setSelectedImage: selectImg];


2 参考链接

[ios]TabBarController didSelectViewController不工作

http://www.itstrike.cn/Question/4ff33206-07c3-4fd3-a20b-4f764daf4677.html


UITabBarController的使用总结

http://blog.163.com/l1_jun/blog/static/143863882012519237110/

你可能感兴趣的:(【IOS开发基础系列】UITabBarController专题)