UIImageVIew
来源:互联网 发布:linux的网络配置文件 编辑:程序博客网 时间:2024/05/05 04:41
属性
//创建UIImageView UIImageView * imageView = [[UIImageView alloc] initWithFrame:self.window.bounds];/---------------------属性----------------------/ //添加图片 imageView.image = [UIImage imageNamed:@"name"]; //图片模式 /*************************************** UIViewContentModeScaleToFill, 默认拉伸 UIViewContentModeScaleAspectFit, 按比例拉伸,不会造成形变 UIViewContentModeScaleAspectFill, 按比例铺满整个屏幕,造成变形 ***************************************/ imageView.contentMode = UIViewContentModeScaleAspectFill; //子视图是否接受点击事件,默认是NO imageView.userInteractionEnabled = YES;
播放image动画
//1:创建可变数组 NSMutableArray * imageArray = [[NSMutableArray alloc] init]; //2:循环读取图片 for (int i = 1; i <= 17; i++) { //读取图片 UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"campFire%02i.gif",i]]; //读出来的图片放进数组 [imageArray addObject:image]; } //3:把图片数组添加到imageView进行播放 imageView.animationImages =imageArray; //动画时长 imageView.animationDuration = 2; //动画次数 imageView.animationRepeatCount = 100; //开始动画 [imageView startAnimating];
0 0
- UIImageView
- UIImageView
- UIImageView
- UIImageView
- UIImageView
- UIImageView
- UIImageView
- UIImageView
- UIImageView
- UIImageView
- UIImageView
- UIImageView
- UIImageView
- UIImageView
- UIImageView
- UIImageView
- UIImageView
- UIImageView
- 2016 UESTC Training for Data Structures K - 郭大侠与甲铁城 CDOJ 1342 离线树状数组
- 从自我学习到深层网络
- HDU5239 Doom
- link quiz
- 【LeetCode】Number of 1 Bits 解题报告
- UIImageVIew
- iOS开发资源大全
- Hive 和普通关系数据库的异同
- Android改变Activity切换时的动画
- 超详细servlet+jdbc+html+css实现后台管理登陆
- ActiveMQ实战(一)-入门篇
- <LeetCode OJ> 89. Gray Code
- 2016 UESTC Training for Data Structures L - 郭大侠与苦恼 CDOJ 1284 map+启发式合并
- Ubuntu安装reportlab