LinearLayout按下(pressed)或获取焦点(focused)时背景设置不同颜色或图片

 1 <LinearLayout   
 2     xmlns:android="http://schemas.android.com/apk/res/android"  
 3     android:id="@+id/myview"  
 4     android:orientation="horizontal"  
 5     android:layout_width="fill_parent"  
 6     android:layout_height="wrap_content"  
 7     android:gravity="top"  
 8     android:background="@drawable/myDrawable"  
 9     android:clickable="true" >  
10 </LinearLayout>

加上 android:clickable="true" 就可以了

posted on 2014-09-11 22:19  Ronald9  阅读(614)  评论(0编辑  收藏  举报

导航