我正在尝试创建可点击的文本框,在按下时像列表视图项一样突出显示。我有自己想要使用的背景图片,所以我无法使用
android:background="?android:attr/selectableItemBackground"
当我在使用我自己的背景图像作为文本框的同时单击文本框时,有没有一种方法可以实现蓝色的“发光”效果?目前,我的文本视图看起来像:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/title"
style="@style/ListSeparatorTextViewStyle"
android:paddingLeft="10dip"
android:paddingRight="10dip"
android:focusable="true"/>
更新:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:background="?android:attr/selectableItemBackground"
android:state_pressed="true" />
<item android:drawable="@drawable/list_section_divider_holo_custom"></item>
</selector>