简体   繁体   English

如何通过图像的透明像素显示UIImage背景

[英]How to show UIImage background through transparent pixels of image

I have an image, that has transparent areas and a known backround. 我有一幅图像,该图像具有透明区域和已知的背景。 But wheh I set "image" property of the UIImage i see main view and not a color which i set in "background" property. 但是,当我设置UIImage的“图像”属性时,我看到的是主视图,而不是我在“背景”属性中设置的颜色。

I think I tried that before and found no real solution. 我想我以前曾尝试过,但没有找到真正的解决方案。 You could however put the uiimageview into an uiview with the same size and set the backgroundcolor to this view. 但是,您可以将uiimageview放入具有相同大小的uiview中,并将backgroundcolor设置为此视图。

Had to create custom control with two UIImageViews bounded by obu UIView. 必须使用由obu UIView界定的两个UIImageViews创建自定义控件。 It works, but i would prefer apple doing something about this behaviour 它有效,但是我更喜欢苹果对此行为做些事情

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM