iOS图片优化加载本地图片
作者:
z_z | 来源:发表于
2019-06-06 11:47 被阅读0次 UIImageView *imageV = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];;
//低效
imageV.image = [UIImage imageNamed:@"图片.png"];
//高效
NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
NSString *filePath = [resourcePath stringByAppendingPathComponent:@"图片.png"];
UIImage *image = [UIImage imageWithContentsOfFile:filePath];
imageV.image = image;
[self.view addSubview:imageV];
本文标题:iOS图片优化加载本地图片
本文链接:https://www.haomeiwen.com/subject/kavyxctx.html
网友评论