嗨 如何將edittext background屬性設置爲動態透明。動態設置背景屬性爲透明的editext
setBackgroundColor()
setBackgroundDrawable()
setBackgroundResource()
這些選項只在當前可用。 如何設置背景totransparent與此方法。 請幫我解決這個問題。
嗨 如何將edittext background屬性設置爲動態透明。動態設置背景屬性爲透明的editext
setBackgroundColor()
setBackgroundDrawable()
setBackgroundResource()
這些選項只在當前可用。 如何設置背景totransparent與此方法。 請幫我解決這個問題。
最好的和真正的辦法:
setBackgroundColor(getResources().getColor(android.R.color.transparent));
試試這個
view.startAnimation(new AlphaAnimation(1, 0));
這是正確的解決方案,以透明的方式顯示編輯文本 – user637503 2011-03-14 12:33:18
您可以設置animationListener並執行onEnd ar onStart。 – RomaTTi 2011-03-14 12:40:09
請試試這個
setBackgroundColor(Color.argb(0, 0, 0, 0));
您還可以設置在XML文件中的EditText。
android:background="@android:color/transparent"
您可以使用setBackgroundColor()方法並傳遞AARRGGBB形式的八位十六進制值。
AA =α通道(該通道限定了透明度) RR =紅色通道 GG =綠色通道 BB =藍色通道
所以調用的setBackground(0x880000FF)將背景設置爲一個半透明的藍色。 開頭的0x表示以十六進制描述下面的值。
使用
setBackgroundColor(Color.TRANSPARENT);
嘗試用特定的animatin做startAnimation。 – RomaTTi 2011-03-14 12:21:53
謝謝編輯..請回答這個... – user637503 2011-03-14 12:22:29
嗨,你會幫我實現包裝效果爲textview創建的動態。我已經嘗試了幾乎解決方案提供在stackoverflow site.but我發現沒有什麼工作out.will你建議我一個解決方案。 – user637503 2011-03-14 12:24:23