美文网首页
UITabBarController的细节

UITabBarController的细节

作者: 张俊凯 | 来源:发表于2018-08-06 10:59 被阅读4次

    设置子控制器时候设置的细节

    //这里设置标题 马上就能显示  在控制器设置的话 只有点击才能显示
        childController.tabBarItem.title = title;
        //设置选中的颜色
        [childController.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor redColor]} forState:UIControlStateSelected];
        //每一个控制器 都能直接访问 tabbar的图片
        childController.tabBarItem.image = [[UIImage imageNamed:image] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
        childController.tabBarItem.selectedImage = [[UIImage imageNamed:selectedImage] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    

    相关文章

      网友评论

          本文标题:UITabBarController的细节

          本文链接:https://www.haomeiwen.com/subject/zzywvftx.html