2011-11-11 29 views
0

當按下時,是否有任何方式爲文字添加輝光效果。我們可以通過使用文本選擇器來做到這一點嗎?按下時在文字周圍添加輝光

+1

選擇器可以幫助您設置的EditText的背景由@繪製/ editbox_bg。這是一個發光效果的例子http://mobile.tutsplus.com/tutorials/android/customize-android-fonts/ –

回答

0

在可繪製文件夾中創建一個xml文件名editbox_bg.xml。 寫入editbox_bg.xml文件以下代碼:

<?xml version="1.0" encoding="utf-8"?> 
<selector xmlns:android="http://schemas.android.com/apk/res/android"> 
    <item android:state_focused="true" android:drawable="@drawable/editbox_background_focus_yellow" /> 
    <item android:drawable="@drawable/editbox_background_normal" /> 
</selector> 

editbox_background_focus_yellow是圖像。就像這樣:--->enter image description here

現在在XML文件中

+0

謝謝你的建議。但我想要的那種發光就像這樣[link] http:// i.stack.imgur.com/UJM4P.png – Pavan

+0

對不起,我不知道。 – atrivedi