<?xml version="1.0" encoding="utf-8"?>  <GridView xmlns:android="http://schemas.android.com/apk/res/android"       android:id="@+id/gridview"      android:layout_width="fill_parent"       android:layout_height="fill_parent"      android:numColumns="auto_fit"      android:verticalSpacing="10dp"      android:horizontalSpacing="10dp"      android:columnWidth="90dp"      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(安卓)Maps
  2. 2011.12.06——— android 带边框的ImageView
  3. android 获得屏幕宽度 高度
  4. Android不错的图片压缩方法
  5. android之Matrix
  6. Android虚线分割Shape
  7. Android(安卓)利用Matrix实现图片随手指平移、旋转、缩放
  8. Android_TextView属性XML详解
  9. Android自定义视图四:定制onMeasure强制显示为方形

随机推荐

  1. Android skia 和open skia的比较
  2. 通过 Android SDK Manager 安装面向 Andr
  3. 常用的布局和View常用属性
  4. Android应用程序开发的五大概念
  5. Eclpise导入android SDK自带的API demos
  6. Android(安卓)json 解析
  7. Android(安卓)BitTube 学习
  8. 第20章、OnCheckedChangeListener事件(从
  9. Android关于线程更新UI的方法
  10. Android(安卓)的属性分析