1、使用Assets.xcassets
设置如下:
Snip20200327_1.png
2、代码设置如下:
UIImage *iconImage = [UIImage imageNamed:@"瞅瞅"];
UIImage *originalImage = [iconImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
Assets.xcassets
设置如下: UIImage *iconImage = [UIImage imageNamed:@"瞅瞅"];
UIImage *originalImage = [iconImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
本文标题:ios 将图片按照原图模式显示
本文链接:https://www.haomeiwen.com/subject/kctsuhtx.html
网友评论