2012년 3월 15일 목요일

리스트 뷰 클릭


<?xml version = "1.0" encoding = "utf-8" ?>
 <selector
 xmlns:android = "http://schemas.android.com/apk/res/android" >

     <item
 android:state_pressed = "true"
 android:drawable = "@android:color/transparent" />

     <item
 android:state_selected = "true"
 android:drawable = "@android:color/transparent" />

     <item
 android:state_focused = "true"
 android:drawable = "@android:color/transparent" />

     <item
 android:drawable = "@drawable/list_item_background_normal" />

 </selector > 

This Drawable will have the exact opposite behavior of the list selector: it will be opaque by default and will become transparent when pressed, focused or selected. The code below refers to thelist_selector_normal.xml (the list_selector_special.xml is very similar and is not available here. Look at the sample code for more details):

댓글 없음:

댓글 쓰기