UITabBarController使用心得

vc1.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"动态" image:[self OriginalImageName:@"tabbar_icon_auth"] selectedImage:[self OriginalImageName:@"tabbar_icon_auth_click"]];
- (UIImage *)OriginalImageName:(NSString *)imageName
{
    return [[UIImage imageNamed:imageName] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}


2.调整tabbaritem中某个图片的位置方法
vc3.tabBarItem.imageInsets = UIEdgeInsetsMake(5, 0, -5, 0);
//字体属性设置
[vc1.tabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor blackColor],NSForegroundColorAttributeName, nil] forState:UIControlStateNormal];


本文出自 “网络学习总结” 博客,谢绝转载!

你可能感兴趣的:(tabbar)