UITabbar 相关属性设置
来源:互联网 发布:淘宝哪家店羊绒布料好 编辑:程序博客网 时间:2024/05/01 10:10
背景颜色的设置
1
2
NSString *tabbarBackgroundImage = [[NSBundle mainBundle] pathForResource:@
"bg_tabbar@2x"
ofType:@
"png"
];
[[UITabBar appearance] setBackgroundImage:[UIImage imageWithContentsOfFile:tabbarBackgroundImage]];
tabbar选择后的背景设置(这里由于图片的大小,做了一下图片的大小调整)
1
2
3
4
UIImage *image = [UIImage imageWithContentsOfFile:tabbarBackgroundImage];
CGSize size = CGSizeMake(20.0, 0.5);
UIImage *resizeImage = [self reSizeImage:image toSize:size];
[[UITabBar appearance] setSelectionIndicatorImage:resizeImage];
tabbar字体的颜色设置
1
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor grayColor],UITextAttributeTextColor, nil] forState:UIControlStateNormal];
加一个图片重新调整的函数
1
2
3
4
5
6
7
8
9
10
- (UIImage *)reSizeImage:(UIImage *)image toSize:(CGSize)reSize
{
UIGraphicsBeginImageContext(CGSizeMake(reSize.width, reSize.height));
[image drawInRect:CGRectMake(0, 0, reSize.width, reSize.height)];
UIImage *reSizeImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return
reSizeImage;
}
0 0
- UITabbar 相关属性设置
- iphone开发之设置UITabBar的相关属性
- iphone开发之设置UITabBar的相关属性
- iOS之UITabBar 的相关属性
- UITabbar相关
- UITabBar隐藏相关处理
- UITabBar隐藏相关处理
- aspxGridView 相关属性设置
- frameset属性相关设置
- frameset属性相关设置
- vstudio相关属性设置
- ListView 相关属性设置
- UITabBar的常用设置
- 设置uitabbar的效果
- UITabBar部分自定义设置
- UITABBAR特殊样式设置
- DataGirdView常见相关属性设置
- visifire 控件相关属性设置
- Java Web应用开发实例
- Android开发之adb命令
- CAS相关文章
- strerror()—返回错误原因的描述字符串
- JDBC超时详解
- UITabbar 相关属性设置
- 黑马程序员--String
- C# WinForm开发系列 - DataGridView
- glib常用库函数和一些定义
- Java Jetty 结合 hessian 使用小例子
- Spring 实例入门
- 资源下载
- ASP.NET MVC4细嚼慢咽---(5)js css文件合并
- CentOS-6.5安装Cmake