在UIImageView上清除背景颜色? [英] Clear Background color on UIImageView?

查看:102
本文介绍了在UIImageView上清除背景颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我有一个带有圆角的PNG图像的UIimageView,图像很好,唯一的问题就是我可以看到带有白色背景的UIImage角落,我怎样才能使背景清晰透明。

hello i have a UIimageView with a PNG image that has round corners, image sits fine the only problem it has is that i can see the UIImage Corners with a white background, how can I make the background clear and transparent.

推荐答案

试试这个:

imageView.backgroundColor = [UIColor clearColor];
imageView.opaque = NO;

你可以通过使'背景'成为0%不透明度的颜色在IB中实现同样的目的,并且点击'不透明'复选框。

You can achieve the same thing in IB by making the 'Background' a color with 0% opacity, and unticking the 'Opaque' checkbox.

这篇关于在UIImageView上清除背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆