以下是ListView的布局:
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#000000">
<View
android:layout_width="fill_parent"
android:layout_height="368px"
android:background="@drawable/h_bg"/>
<ListView
android:id="@+id/lv_main"
android:layout_marginLeft="16px"
android:layout_marginTop="20px"
android:layout_width="448px"
android:layout_height="wrap_content"
android:cacheColorHint="#00000000"
android:divider="#00000000"
android:dividerHeight="10dip"
android:listSelector="@drawable/detail_list_item_selector"
/>
</RelativeLayout>以下是detail_list_item_selector
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The stateful background drawable for a widget -->
<item android:state_window_focused="false" android:drawable="@drawable/groupbox"/>
<item android:state_pressed="true" android:drawable="@drawable/group_list_sel_feedback"/>
<item android:state_focused="true" android:drawable="@drawable/group_list_sel_feedback"/>
<item android:drawable="@drawable/groupbox"/>
</selector>为什么ListView的Item背景没有显示groupbox呢?貌似android:state_window_focused="false"没有起作用?
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#000000">
<View
android:layout_width="fill_parent"
android:layout_height="368px"
android:background="@drawable/h_bg"/>
<ListView
android:id="@+id/lv_main"
android:layout_marginLeft="16px"
android:layout_marginTop="20px"
android:layout_width="448px"
android:layout_height="wrap_content"
android:cacheColorHint="#00000000"
android:divider="#00000000"
android:dividerHeight="10dip"
android:listSelector="@drawable/detail_list_item_selector"
/>
</RelativeLayout>以下是detail_list_item_selector
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The stateful background drawable for a widget -->
<item android:state_window_focused="false" android:drawable="@drawable/groupbox"/>
<item android:state_pressed="true" android:drawable="@drawable/group_list_sel_feedback"/>
<item android:state_focused="true" android:drawable="@drawable/group_list_sel_feedback"/>
<item android:drawable="@drawable/groupbox"/>
</selector>为什么ListView的Item背景没有显示groupbox呢?貌似android:state_window_focused="false"没有起作用?
解决方案 »
- 跪求-!百度地图读数据库经纬度数据地图上定位源码
- android自带phone应用关闭问题
- androidpn消息推送
- 运行简单的Jbox2d程序报缺少AABB class
- [源码共享]提取Launcher中的WorkSapce,可以左右滑动切换屏幕页面的类
- android 问题求救
- android opengles 手机唤醒后 界面上的图形的贴图都没有了,图形呈白色
- 求助,新建project 的gen中无法生成R.java,在网上找了各种方法都没有用
- 求教 大神 Android 图形解锁和Activity销毁的问题?
- Smart210开发板 表层用安卓4.0.3系统,利用USB与电脑完成数据收发
- 如何让程序的界面不翻转
- android程序安装路径
去掉<item android:drawable="@drawable/groupbox"/>试试
看看有没有变化