博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
UIImageView常用属性和方法
阅读量:2339 次
发布时间:2019-05-10

本文共 1788 字,大约阅读时间需要 5 分钟。

一、常用属性

1、image: default is nil。图片属性

2、highlightedImage: default is nil。高亮状态图片属性

3、userInteractionEnabled: default is NO。用户是否可以交互属性

4、highlighted: default is NO。判断图片是否是高亮状态

these allow a set of images to be animated. the array may contain multiple copies of the same(下面属性允许图像组动画,该数组内可能包含相同的多个副本)

5、animationImages: The array must contain UIImages. Setting hides the single image. default is nil。该数组当中必须包含多张图片,设置单张图片将被隐藏,默认 nil

@property (nullable, nonatomic, copy) NSArray<UIImage *> *animationImages;

6、highlightedAnimationImages: The array must contain UIImages. Setting hides the single image. default is nil.高亮状态的组动画。

7、animationDuration: for one cycle of images. default is number of images * 1/30th of a second (i.e. 30 fps)。动画播放时间,对于一个周期的图像,默认的是图像是一秒30帧。

@property (nonatomic) NSTimeInterval animationDuration;

8、animationRepeatCount: 0 means infinite (default is 0)。动画循环次数。0意味着无限(默认0)。

@property (nonatomic) NSInteger      animationRepeatCount;

9、tintColor: 给控件内子视图设置颜色。详细信息请见 UIImage类属性。

10、focusedFrameGuide: if adjustsImageWhenAncestorFocused is set, the image view may display its image in a larger frame when focused.this layout guide can be used to align other elements with the image view's focused frame.如果设置了adjustsImageWhenAncestorFocused,图像视图可以在一个更大的 frame 中显示其图片的焦点。这个布局指南,可用于将其他元素与图像视图的聚焦帧对齐。

@property(readonly,strong) UILayoutGuide *focusedFrameGuide;

二、常用方法

1、initWithImage:: 构造方法,在初始化对象时直接进行默认图片进行赋值。

- (instancetype)initWithImage: (nullable UIImage *)image;

2、initWithImage:highlightedImage:: 构造方法,在初始化对象时直接给默认和高亮图片进行赋值

- (instancetype)initWithImage: (nullable UIImage *)image highlightedImage: (nullable UIImage *)highlightedImage;

3、startAnimating:: 开始动画

- (void)startAnimating;

4、stopAnimating:: 结束动画

- (void)stopAnimating;

5、isAnimating:: 动画中

- (BOOL)isAnimating;

转载地址:http://fcwvb.baihongyu.com/

你可能感兴趣的文章
AIX 安全命令
查看>>
AIX故障定位
查看>>
AIX运行级别介绍
查看>>
Linux zombie进程
查看>>
Linux 的僵尸(zombie)进程
查看>>
linux chmod 命令详解 改变文件属性
查看>>
并发编程实战学习笔记(九)-显式锁
查看>>
并发编程实战学习笔记(十)-构建自定义的同步工具
查看>>
并发编程实战学习笔记(十一)-原子变量与非阻塞同步机制
查看>>
分布式系统的事务处理
查看>>
硅胶制品为何丝印后字符会掉?
查看>>
模压硅胶产品成型后加工工艺
查看>>
印花硅胶模压成型跟丝印成型产品有什么区别
查看>>
简述:为什么硅胶按键要使用镭雕工艺?
查看>>
在硅胶产品表面处理中,丝印、移印与镭雕的区别
查看>>
java 内存模型:重排序
查看>>
spring IOC容器:控制反转
查看>>
处理器重排序与内存屏障
查看>>
Java内存模型 之三个特性:
查看>>
Java内存 happens-before原则
查看>>