如何通过图像的透明像素显示UIImage背景
我有一个图像,它具有透明区域和已知的背景。但是当我设置 UIImage 的“图像”属性时,我看到主视图,而不是我在“背景”属性中设置的颜色。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想我之前尝试过,但没有找到真正的解决方案。但是,您可以将 uiimageview 放入具有相同大小的 uiview 中,并将背景颜色设置为此视图。
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.
必须创建带有两个由 obu UIView 界定的 UIImageView 的自定义控件。它有效,但我更希望苹果对此行为采取一些措施
Had to create custom control with two UIImageViews bounded by obu UIView. It works, but i would prefer apple doing something about this behaviour