IOS UIView 图片填充问题
UIImage *image = [UIImage imageNamed:@"name.png"];
//还有一种是这样的,感觉这样挺不错的 <span style="color:#990000;">UIImage *image = [UIImage imageWithContentsOfFile:path];</span>
view.layer.contents = (id)image.CGImage;
//如果需要背景透明加上下面这句
view.layer.backgroundColor = [UIColor clearColor].CGColor;
本文来自博客园,作者:赫凯,转载请注明原文链接:https://www.cnblogs.com/heKaiii/p/15491359.html