gridview划线

gridview设置划线颜色

<color name="line_color">#e8edf3</color>
<View
android:background="@color/line_color"
android:layout_width="match_parent"
android:layout_height="0.5dp"/>
<GridView
android:background="@color/line_color"
android:numColumns="auto_fit"
android:id="@+id/my_grid"
android:horizontalSpacing="1dp"
android:verticalSpacing="1dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</GridView>
<View
android:background="@color/line_color"
android:layout_width="match_parent"
android:layout_height="0.5dp"/>


 

item设置背景色

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="vertical"
android:gravity="center"
android:background="#ffffff"
android:layout_margin="1dp"
>


<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>

<TextView
android:gravity="center"
android:layout_gravity="center"
android:id="@+id/text"
android:layout_marginTop="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black_textview"
android:text="文字"
/>

</LinearLayout>

显示gridview设置的背景色

posted on 2017-04-11 18:54  yaolunhui  阅读(174)  评论(0编辑  收藏  举报

导航