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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,638评论 25 708
  • 发现 关注 消息 iOS 第三方库、插件、知名博客总结 作者大灰狼的小绵羊哥哥关注 2017.06.26 09:4...
    肇东周阅读 12,259评论 4 61
  • 1.简单认识 UIImageView对象提供了一个基于视图的容器来展示一张或者一系列图像,同时也支持以动画的方式来...
    Kevin_wzx阅读 821评论 0 0
  • 连续213天灵修经文 【代下29:11】我的众子啊,现在不要懈怠,因为耶和华拣选你们站在他面前侍奉他,与他烧香。”...
    报佳音阅读 243评论 0 0
  • 1>面试: 控制器的生命周期 2>面试: iOS6:viewdidunload, (方法了解)当VC的View被卸...
    提莫不胖阅读 131评论 0 0