首页 > 解决方案 > 网格视图的分隔线颜色

问题描述

在此处输入图像描述

在下图中,我使用网格视图并且有一个背景图像。我已将网格视图项设为半透明。现在我想要分隔线颜色为白色。我怎么能做到这一点。是否有任何参数。

标签: androidandroid-layoutandroid-gridview

解决方案


尝试这个

<GridView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="your_divider_color"
        android:horizontalSpacing="1dp"
        android:numColumns="auto_fit"
        android:stretchMode="columnWidth"
        android:verticalSpacing="1dp" >

在你的情况下,your_divider_color应该是@android:color/transparen


推荐阅读