ListView背景修饰
16lz
2021-01-23
demo:
"@+id/lv_left_menu" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="50dp" android:divider="@android:color/transparent" //取出ListView自带的分割线。 android:listSelector="@android:color/transparent" />
这个可以去掉listView自带的触摸时的背景颜色。 注意这个@null不起作用android:listSelector="@android:color/transparent" android:divider="@android:color/transparent" 设置分割线不显示。
ListView 上字体按压下和松开后颜色的改变: 选中和不选中颜色的区别,像RadioButton的字体的颜色(check 选择时);
listview只能用enable: 属性为enable,做状态选择器时用。
ListView 上下滑动时如果出现黑色背景,改变的办法:
android:cacheColorHint="#fff" 缓存隐藏颜色是强制改为白色。
再给ListView添加headView时,需要注意作为headView的布局文件的根部局不要将宽高写死。
更多相关文章
- Android中背景选择器
- zz浅谈android的selector,背景选择器
- 【Android】编写Drawable XML绘制底部带指示条的背景
- Android Studio App设置TextView文字内容大小颜色
- Android TextView 中如何使用第三方字体
- 去除或替换listview 默认的点击选中时的颜色