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


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