子控制器模型
发布日期:2022-02-15 02:36:17 浏览次数:4 分类:技术文章

本文共 869 字,大约阅读时间需要 2 分钟。

-(void)addChildViewController:(UIViewController *)childCtrl imageName:(NSString *)imageName title:(NSString *)title {

    

    //    UITabBarController * homeTbc = [UITabBarController new];

    childCtrl.tabBarItem.image = [[UIImage imageNamed:imageName] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

    childCtrl.tabBarItem.selectedImage = [[UIImage imageNamed:[NSString stringWithFormat:@"%@_highlighted", imageName]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

    childCtrl.tabBarItem.title = title;

    

    NSMutableDictionary * dic = [NSMutableDictionary dictionary];

    dic[NSForegroundColorAttributeName] = [UIColor orangeColor];

    //指定选中状态下文字颜色

    [childCtrl.tabBarItem setTitleTextAttributes:dic forState:UIControlStateSelected];

    

    UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController:childCtrl];

    

    [self addChildViewController:nav];

    

    

}

转载地址:https://blog.csdn.net/Peter_AM/article/details/50156879 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:设置UIImage的渲染模式
下一篇:UIButton状态

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2024年03月01日 08时04分10秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章