设置UIView 背景图片二方法
来源:互联网 发布:sql 选取最大值 编辑:程序博客网 时间:2024/05/22 08:18
方法一:
UIView *theMainView =[ [UIView alloc] init];
UIImage *image = [UIImage imageNamed:@"bg.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image] ;
[theMainView addSubview:imageView];
方法二:
[theMainView setBackgroundColor: [UIColor colorWithPatternImage: [UIImage imageNamed: @"bg.png"]]];
imageName 缓存,下面方法不缓存
NSString *thePath= [[NSBundle mainBundle] pathForResource:@"default" ofType:@"jpeg"];
UIImage *prodImg= [[UIImage alloc] initWithContentsOfFile:thePath"];
controller.productImg.image= prodImg;
[prodImg release];
- 设置UIView 背景图片二方法
- UIView设置背景图片的方法
- UIView设置背景图片的方法
- UIView设置背景图片的方法
- UIView设置背景图片的方法
- UIView 设置背景图片的方法
- UIView设置背景图片的方法
- UIView设置背景图片的方法
- UIView设置背景图片的方法
- UIView设置背景图片的方法
- UIView设置背景图片的方法
- ios UIView设置背景图片的方法
- ios UIView设置背景图片的方法
- UIView设置背景图片的几种方法
- 设置UIView背景图片
- 设置UIView背景图片
- iOS UIView设置背景图片
- UIView设置背景图片
- macro
- GridView控件
- 各种滤波器的设计
- (Flash CS5) Java运行时环境初始化时出现错误,你可能需要重新安装Flash(CS5)
- U-Boot编译过程完全分析
- 设置UIView 背景图片二方法
- DataReader用法
- mysql变量使用总结
- smarty内建函数
- JS实现图片翻书效果
- Boot Memory分配器
- window.parent和window.opener区别
- 什么是SyncML
- 策略模式实现