记录一些容易忘记的属性 -- UIImageView
UIImage *image = [UIImage imageNamed:@"back2.jpg"]; //创建一个图片对象,这个方法如果图片名称相同,不管我们调用多少次,得到的都是同一个图片对象。
self.view.backgroundColor = [UIColor colorWithPatternImage:image]; //设置当前视图的背景颜色为图片的颜色。
imageView.contentMode = UIViewContentModeScaleToFill; //设置ImageView的内容模式
使用下面的方法可以实现动画效果
[UIView animateWithDuration:<#(NSTimeInterval)#> animations:^{
<#code#>
}];
UIImageView实现动画效果
//1.创建一个数组
NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:10];
//创建当前视图动画的图片对象,将图片对象添加到数组中
for (int i = 1; i < 19; i++) {
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"DOVE %d", i]];
[array addObject:image];
// imageView.animationImages
}
//设置动画数组
imageView.animationImages = array;
//设置完成一次动画所需的时间
imageView.animationDuration = 0.5;
//设置动画的重复次数(默认为0,0表示无限次数)
imageView.animationRepeatCount = 0;
//开始动画
[imageView startAnimating];
// - (void)startAnimating; 开始动画
// - (void)stopAnimating; 停止动画
// - (BOOL)isAnimating; 判断动画是否在进行中
记录一些容易忘记的属性 -- UIImageView的更多相关文章
- 记录一些容易忘记的属性 -- UINavigationController
//设置导航栏的风格 self.navigationController.navigationBar.barStyle = UIBarStyleDefault; //设置导航栏是否透明 N ...
- 记录一些容易忘记的属性 -- UIButton
//设置按钮文字字体(这个只在自定义button时有效) btn1.titleLabel.font = [UIFont systemFontOfSize:30]; showsTouchWhenH ...
- 记录一些容易忘记的属性 -- UITabBarController
UIViewController中的 @property(nonatomic,copy) NSString *title; // Localized title for use by a pare ...
- 记录一些容易忘记的属性 -- UIScrollView
UIScrollView * sv = [[UIScrollView alloc] init]; //设置是否显示水平滚动条 sv.showsHorizontalScrollIndicator ...
- 记录一些容易忘记的属性 -- UIGestureRecognize手势
//一个手势只能添加到一个view上面 //设置当前手势需要的点击次数 _tapRec.numberOfTapsRequired = 1;//(默认为1) //设置当前需要几个手指同时点击 ...
- 记录一些容易忘记的属性 -- UIKeyboard
//UIKeyboardWillShowNotification这个通知在软键盘弹出时由系统发送 //UIKeyboardWillShowNotification 通知:键盘将要显示的通知 ...
- 记录一些容易忘记的属性 -- NSTimer
使定时器停止的方法: 1. //将定时器的启动时间设置为很久以后的将来,到这个时间,定时器才会开始工作 [_timer setFireDate:[NSDate distantFu ...
- 记录一些容易忘记的属性 -- UIView
一个视图原来添加在某个父视图上,然后再将它添加到另外的一个视图上,这个视图会从原来的某个父视图中移除,添加到新的视图上. 子视图对象指针存在父视图的subviews数组中,说明,一个视图可以有多个子视 ...
- 记录一些容易忘记的属性 -- UILabel
一:UILabel lbl.alpha=0.f; lbl 透明,会影响子视图的显示 lbl.backgroundColor=[UIColor clearColor]; lbl 背景色透明,子视图 ...
随机推荐
- lftp
linux安装FTP工具 lftp及使用教程 来源:网络 发布时间:2013-05-24 15:21 字体:[大 中 小] 点击2510次 linux下可以直接通过FTP命令进行ftp上传下载,不 ...
- Hbase之测试数据
info ship user name age height phone addr email dept salary create 'user','info','ship'; put 'user', ...
- PHP 递归的密码
http://www.cnsecer.com/4146.html 说实话 真的很炫 好像还是不好理解啊
- android用shape给linearLayout设置边框,怎样只保留底部或顶部的边框,把其它三个方向的边框去掉呢?
http://bbs.csdn.net/topics/390485215 这种方法只是两个颜色块相减而已 <?xml version="1.0" encoding=" ...
- Canu FAQ常见问题
链接:Canu FAQ Q: What resources does Canu require for a bacterial genome assembly(细菌基因组组装)? A mammal ...
- 能源项目xml文件 -- springMVC-servlet.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...
- Android LayoutParams
LayoutParams继承于Android.View.ViewGroup.LayoutParams,就是布局. LayoutParams相当于一个Layout的信息包,它封装了Layout的位置.高 ...
- Qt之可重入与线程安全
简述 本篇文章中,术语"可重入性"和"线程安全"被用来标记类与函数,以表明它们如何被应用在多线程应用程序中. 一个线程安全的函数可以同时被多个线程调用,甚至调用 ...
- hdu----(1599)最大子矩阵(几何/dp)
最大子矩阵 Time Limit: 30000/10000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Sub ...
- Word Search [LeetCode]
Problem Description: http://oj.leetcode.com/problems/word-search/ Basic idea: recursively go forward ...