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];


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章