使用Selector.xml
文件inyour绘制,然后使用两个不同的背景图片。一个是悬停图像另一个是正常图像。
例:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/hover_Bg" android:state_pressed="true"></item>
<item android:drawable="@drawable/hover_Bg" android:state_focused="true"></item>
<item android:drawable="@drawable/normal_Bg"></item>
</selector>
在你的布局设置这样的。
<EditText
android:id="@+id/firstname_edt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:background="@drawable/Selector"
android:inputType="textPersonName" >
</EditText>
,你使用的是什么?是混合应用程序或原生Android应用程序? – anand4tech
是的,它是一个混合应用程序 – user2761566
使用user-scalable = no“在meta标记中的html – anand4tech