UIImageView

好像基本只用来展示图片。

属性

    self.imageView.image = [UIImage imageNamed:@"iconfont-nianhua-12"];
    self.imageView.highlightedImage = [UIImage imageNamed:@"iconfont-nianhua-7"];
    
    self.imageView.animationImages = arr;// 播放图片数组
    self.imageView.highlightedAnimationImages = arr;// 同上类似
    
    self.imageView.animationDuration = arr.count * 0.1;// 播放一次循环的时间
    self.imageView.animationRepeatCount = 0;// 0 无限循环
    
    self.imageView.userInteractionEnabled = YES;// 用户交互
    self.imageView.tintColor = [UIColor redColor];
    

动画

// 设置 高亮
    [self.imageView setHighlighted:YES];
    
// 播放 停止
    if (self.imageView.isAnimating) {
        [self.imageView stopAnimating];
    } else {
        [self.imageView startAnimating];
    }
    
// 或者
    self.imageView.isAnimating ? [self.imageView stopAnimating] : [self.imageView startAnimating];
    

其他

@property (nonatomic) BOOL adjustsImageWhenAncestorFocused UIKIT_AVAILABLE_TVOS_ONLY(9_0);
@property(readonly,strong) UILayoutGuide *focusedFrameGuide UIKIT_AVAILABLE_TVOS_ONLY(9_0);

1

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 176,772评论 25 709
  • 发现 关注 消息 iOS 第三方库、插件、知名博客总结 作者大灰狼的小绵羊哥哥关注 2017.06.26 09:4...
    肇东周阅读 14,772评论 4 61
  • 1.简单认识 UIImageView对象提供了一个基于视图的容器来展示一张或者一系列图像,同时也支持以动画的方式来...
    Kevin_wzx阅读 4,314评论 0 0
  • 1>面试: 控制器的生命周期 2>面试: iOS6:viewdidunload, (方法了解)当VC的View被卸...
    提莫不胖阅读 1,157评论 0 0
  • 每天阅读30分钟 「被讨厌的勇气」并不是要去吸引被讨厌的负向能量,而是,如果这是我生命想绽放出最美的光彩,那么,即...
    暖叔阅读 1,612评论 0 0

友情链接更多精彩内容