自定义UITabBarController的tabBar背景图片
来源:互联网 发布:log4j 性能优化 编辑:程序博客网 时间:2024/06/06 01:25
新建一个类继承UITabBarController:
- (id) init
{
self = [super init];
if (self) {
//方法一
UIImageView *img = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bg.png"]];
img.frame = CGRectMake(0, 0, self.tabBar.frame.size.width, self.tabBar.frame.size.height);
img.contentMode = UIViewContentModeScaleToFill;
//img.frame = CGRectOffset(img.frame, 0, 1);
[[self tabBar] insertSubview:img atIndex:0];
[img release];
//方法二
CGRect frame = CGRectMake(0, 0, self.view.bounds.size.width, 49);
UIView *view = [[UIView alloc] initWithFrame:frame];
UIImage *tabBarBackgroundImage = [UIImage imageNamed:@"bg.png"];
UIColor *color = [[UIColor alloc] initWithPatternImage:tabBarBackgroundImage];
[view setBackgroundColor:color];
[color release];
[[self tabBar] insertSubview:view atIndex:0];
[view release];
}
return self;
}
- 自定义UITabBarController的tabBar背景图片
- 自定义UITabBarController的tabBar背景图片
- 自定义UITabBarController的tabBar背景图片
- UITabBarController更换tabBar背景图片
- UITabBarController和UINavigationBar更换tabBar背景图片
- 隐藏UITabBarController的tabBar
- iOS UITabBarController tabbar 自定义 详解
- iOS 原生UITabBarController 的tabbar 图标状态自定义
- iOS-快速自定义UITabBarController内的tabbar控件
- IOS快速自定义UITabBarController内的TabBar控件
- ios更改UITabBarController背景以及选中背景图片的方法 以及隐藏tabbar
- iOS自定义控件 - 自定义UITabBarController中的TabBar
- 变相隐藏UITabBarController的TabBar
- UITabBarController+UINavigationController 实现自定义TabBar样式
- iPhone自定义UITabBarController,好像是Instagram的作者写的。 自定义 tabbar
- 《 Swift UITabBarController 的使用和自定义TabBar,和部分属性和代理的使用》
- Swift中如何通过KVC将自定义的UITabbar设置为UITabbarController的tabbar
- UITabBarController的 tabBar 高度动态调节
- 二叉排序树的建立,删除
- 一个C++加密工具EncryptDecrypt.dll
- 主分区,扩展分区,逻辑分区的由来
- 我的日记1
- php-cgi进程占用cpu资源过多负载高的原因分析及解决步骤
- 自定义UITabBarController的tabBar背景图片
- MVC 伪静态的实现方式
- PPTP、L2TP和IPsec的区别及优缺点
- python模块库路径设置
- poj 2007(极角排序)
- Hibernate 中的cascade和inverse
- java学习笔记之JavaIO(1):用java读取文本文件
- sql中 in 、not in 、exists、not exists 用法和差别
- linux pptp vpn服务器的架设