标签:
[[UITabBarItem appearance] setTitleTextAttributes:@{ UITextAttributeTextColor : [UIColor blackColor],UITextAttributeFont:[UIFont fontWithName:@"Marion-Italic" size:14.0]} forState:UIControlStateNormal];
UIControState的设置:
UIControlStateNormal:未被选中时;
UIControlStateHighlighted:被选中的时候;
navigation和tabbar上的文字.图片
[self.navigationController.tabBarItem setTitlePositionAdjustment:UIOffsetMake(15, -10)];
uitabbaritem.imageInsets
// 导航底部线条颜色
[self.navigationController.navigationBar setBackgroundImage:[self imageWithColor:[UIColor clearColor]]
forBarPosition:UIBarPositionAny
barMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setShadowImage:[UIImage new]];
// 返回一张纯色图片
- (UIImage *)imageWithColor:(UIColor *)color
{
CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [color CGColor]);
CGContextFillRect(context, rect);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
标签:
原文地址:http://www.cnblogs.com/shifu/p/5726412.html