• tableView性能优化


    在自定义cell时加上这几句代码

            // 1. 栅格化,美工的术语:将 cell 中的所有内容,生成一张独立的图像

            // 在屏幕滚动时,只显示图像

            self.layer.shouldRasterize = YES;

            // 栅格化,必须指定分辨率,否则默认使用 * 1,生成图像!

            self.layer.rasterizationScale = [UIScreen mainScreen].scale;

            

            // 2. 异步绘制!如果 cell 比较复杂,可以使用!

            self.layer.drawsAsynchronously = YES;

    在使用YYWebImage时,cell显示gif图时,可以利用KVC

    // 利用 KVC 修改 imageView 的类型

            [self setValue:[[YYAnimatedImageView alloc] init] forKey:@"imageView"];

  • 相关阅读:
    hdu-4283 You Are the One 区间dp,
    HDU
    HDU
    HDU
    SPOJ
    UESTC
    CodeForces
    HDU
    Git中文书籍
    zeng studio的项目窗口PHP Explorer
  • 原文地址:https://www.cnblogs.com/feiyiban588/p/5780276.html
Copyright © 2020-2023  润新知