我有一个GridView中,我有很多的项目在三个colums。我想增加它们之间的间距。我怎样才能做到这一点在Android的?
I have a gridview in which i have a lot of items in three colums. I want to increase the spacing between them. How can I do that in android?
您可以使用 安卓verticalSpacing
和 机器人:horizontalSpacing
在GridView的标签,并提供了间距按照您的要求
You can use android:verticalSpacing
and android:horizontalSpacing
in GridView tag and provide the spacing as per your requirement.
例如:
<GridView
android:layout_height="wrap_content"
android:id="@+id/gridView1"
android:layout_width="match_parent"
android:numColumns="auto_fit"
android:horizontalSpacing="10dp" // space between two items (horizontal)
android:verticalSpacing="10dp"> // space between two rows (vertical)
</GridView>