如何在iPhone中更改文本字段的背景颜色?

问题描述:

我想将文本字段的背景颜色更改为透明的颜色.我尝试过

I want to change the background color of the textfield to something which is transparent. I have tried

 option5btn.backgroundColor = [UIColor grayColor];

但是我想要其他颜色.谁能告诉我在iPhone文本框的背景中可以使用哪些颜色.

But I want some other color. Can anyone tell me which all colors can be used in the iphone textfield's background.

有人可以帮我吗?

[UIColor colorWithRed:0.2f green:0.3f blue:0.4f alpha:0.50001f];

这是我经常使用的方法.

That's an approach I use regularly.