Display an image or UIImage with a plain CALayer

后端 未结 3 1982
执笔经年
执笔经年 2020-12-13 03:12

I\'ve often read that using a CALayer rather than a UIImageView is an performance boost when it comes to heavy image usage. That makes sense, becau

3条回答
  •  一生所求
    2020-12-13 03:42

    CALayer *layer = [[CALayer alloc] init];
    layer.contents = (__bridge id _Nullable)([UIImage imageNamed:@"REWIFISocketOff"].CGImage);
    

提交回复
热议问题