0
ListView 대신보기를 사용합니다. ListView on touch에서 강조 표시 한 것처럼이보기를 강조 표시하려면 어떻게해야합니까?android에서 listview와 같은 강조보기를 사용하는 방법
ListView 대신보기를 사용합니다. ListView on touch에서 강조 표시 한 것처럼이보기를 강조 표시하려면 어떻게해야합니까?android에서 listview와 같은 강조보기를 사용하는 방법
보기의 배경으로 선택자를 사용하십시오. selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/button_pressed_yellow"
android:state_pressed="true" />
<item android:drawable="@drawable/button_focused_orange"
android:state_focused="true" />
<item android:drawable="@drawable/button_normal_green" />
someOther.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<yourView
android:id="@+id/viewWithSelector"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/selector.xml" />
예 :