增加Android的发车间隔 [英] Increase the grid spacing in android

查看:104
本文介绍了增加Android的发车间隔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个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 机器人:horizo​​ntalSpacing 在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>

这篇关于增加Android的发车间隔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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