开发者

setting the background attribute to transparent in editext dynamically

hi how to set edittext background attribute to transparent dynamically.

开发者_开发技巧
setBackgroundColor()
setBackgroundDrawable()
setBackgroundResource()

these options only available . how to set background totransparent with this methods. Please help me to solve this issue.


The best and genuine way:

setBackgroundColor(getResources().getColor(android.R.color.transparent));


You can use the setBackgroundColor() method and pass an eight-digit hex value in the form of AARRGGBB.

AA = alpha channel (this channel defines the transparency) RR = red channel GG = green channel BB = blue channel

So calling setBackground(0x880000FF) will set the background to a half transparent blue. The 0x at the beginning say that the following value is described in hex.


Please Try this

setBackgroundColor(Color.argb(0, 0, 0, 0));

You can also set in xml file in edittext .

 android:background="@android:color/transparent"


Try this

view.startAnimation(new AlphaAnimation(1, 0));


Use

setBackgroundColor(Color.TRANSPARENT);

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜