UItextview透明颜色IOS

时间:2012-06-17 09:11:50

标签: ios5 uitextview transparent

我想将UItextview的颜色设置为透明但不完全透明。我希望背景上的灰色或黑色与图片完全一样

enter image description here

我现在正在使用此代码

 _textView.backgroundColor = [UIColor clearColor];

如何让它像上面的图片一样透明?任何代码?

2 个答案:

答案 0 :(得分:6)

你应该使用这样的东西:

_textView.backgroundColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.5];

其中alpha - 参数为透明(例如50%)。

答案 1 :(得分:4)

这样做你想要的吗? (您可能需要试验这些值。)

_textView.backgroundColor = [UIColor colorWithWhite:0.5 alpha:0.5];
相关问题