透明的GPUImageView?

7

我在我的iOS应用程序中使用了GPUImageView。我希望GPUImageView具有透明背景。

我尝试使用setBackground:[UIColor clearColor],但它没有起作用。

有什么解决方法吗?

谢谢!

2个回答

11

我发现你需要同时设置这两个参数才能获得透明背景。单独设置其中一个是不起作用的。

strengthPreviewImageView.backgroundColor = [UIColor clearColor];
[strengthPreviewImageView setBackgroundColorRed:0 green:0 blue:0 alpha:0];

3
你尝试过 GPUImageView 头文件中的方法吗?
- (void)setBackgroundColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent alpha:(GLfloat)alphaComponent;

设置背景颜色为红色:1.0,绿色:1.0,蓝色:1.0,透明度:0.0,将会得到白色的背景。 - user559668

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接