在工作的时候想给LinearLayout添加一种变色效果,结果按照最初的思路设置没有任何效果 通过查找各种资料发现了问题所在,当给LinearLayout,RelativeLayout等设置selector时,需要给他们设置android:clickable="ture"属性

android:background="@drawable/selector_hot_dest"
android:clickable="true"
<?xmlversion="1.0"encoding="utf-8"?><selectorxmlns:android="http://schemas.android.com/apk/res/android"><itemandroid:drawable="@drawable/item_pop_hot_destination_bg"android:state_pressed="false"/><itemandroid:drawable="@drawable/item_pop_hot_destination_bg_press"android:state_selected="true"/><itemandroid:drawable="@drawable/item_pop_hot_destination_bg_press"android:state_pressed="true"/></selector>


更多相关文章

  1. android:largeHeap属性
  2. Android:实现一种浮动选择菜单的效果
  3. Android中ImageButton自定义按钮的按下效果的代码实现方法,附网上
  4. Android TextInputLayout 使用及其属性
  5. Android控件Editext、TextView属性详解
  6. android ListView几个比较特别的属性
  7. android 图片切换,仿百叶窗效果

随机推荐

  1. ANDROID Porting系列五、定制化
  2. Android——用户登陆及用户名和密码的保
  3. Android(安卓)Studio单元测试
  4. android AIDL服务
  5. Android入门系列(一)--Android的目录结构
  6. Android 模拟HTTP协议的编码问题 Android
  7. Android Studio使用教程、工程目录结构、
  8. Eclipse SDK 3.7.2无法安装android SDK
  9. Android与H5相机、相册笔记
  10. Android(安卓)NDK学习笔记3-入门案例篇