<GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/myGrid"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:verticalSpacing="10dp"

android:horizontalSpacing="10dp"
android:numColumns="auto_fit"

android:columnWidth="60dp"
android:stretchMode="columnWidth"

android:gravity="center"
/>

介绍一下里面的某些属性:

android:numColumns="auto_fit" ,GridView的列数设置为自动

android:columnWidth="90dp",每列的宽度,也就是Item的宽度
android:stretchMode="columnWidth",缩放与列宽大小同步
android:verticalSpacing="10dp",两行之间的边距,如:行一(NO.0~NO.2)与行二(NO.3~NO.5)间距为10dp
android:horizontalSpacing="10dp",两列之间的边距。

更多相关文章

  1. Android(安卓)2.2完全退出程序, 使用广播机制
  2. Android应用程序用真机调试步骤
  3. android 获取手机信息工具类
  4. 【android】下载文件至本应用程序的file文件夹或者sdcard
  5. Android(安卓)如何保持屏幕长亮?
  6. android获取APK签名信息及MD5指纹
  7. android 出错集
  8. 一分钟实现TextView高亮效果BabushkaText
  9. Android个人开发笔记

随机推荐

  1. Android:方向传感器
  2. android studio recyclerview长按删除
  3. 自定义HttpURLConnection工具类
  4. Android(安卓)getMeasuredHeight()与getH
  5. inputtype 代码对应表
  6. java des3 加密解密
  7. android 元素 的用法
  8. Proguard手册(少量进行了中文翻译)
  9. 5 Android(安卓)json 解析
  10. Android(安卓)welcome欢迎界面