如何改变Android的ListView的分割线的颜色? [英] How to change color of Android ListView separator line?

查看:254
本文介绍了如何改变Android的ListView的分割线的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要改变的ListView 分隔线的颜色。任何帮助将是AP preciated。

I want to change color of ListView separator line. Any help would be appreciated.

推荐答案

您可以在布局XML文件中使用设置这个值安卓分=#FF0000。如果要更改的颜色/绘制,你必须设置/复位分频器的高度了。

You can set this value in a layout xml file using android:divider="#FF0000". If you are changing the colour/drawable, you have to set/reset the height of the divider too.

<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content">

  <ListView 
    android:id="@+id/android:list"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:divider="#FFCC00"
    android:dividerHeight="4px"/>

</LinearLayout>

这篇关于如何改变Android的ListView的分割线的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆