1. <GridViewandroid:id="@+id/grid"
  2. android:layout_width="fill_parent"
  3. android:layout_height="fill_parent"
  4. android:verticalSpacing="35px"<!--grid元素之间的竖直间隔-->
  5. android:horizontalSpacing="5px"<!--grid元素之间的水平间隔-->
  6. android:numColumns="auto_fit"<!--表示有多少列,如果设置为auto_fit,将根据columnWidth和Spacing来自动计算-->
  7. android:columnWidth="100px"<!--一般建议采用有像素密度无关的dip或者dp来表示-->
  8. android:stretchMode="columnWidth"<!--如何填满空余的位置,模拟器采用WVGA800*480,每排4列,有4*100+5*3=415,还余65px的空间,如果是columnWidth,则这剩余的65将分摊给4列,每列增加16/17px。如果采用SpacingWidth,则分摊给3个间隔空隙-->
  9. android:gravity="center"/>

更多相关文章

  1. Gridview的stretchMode详解附自动宽度
  2. GridView的属性---stretchMode详解
  3. 猎鹰与龙飞船基于Linux,采用C++、Chromium与JS开发
  4. Win 10开始采用Windows Update分发WSL2
  5. promise间隔时间添加dom
  6. 「云转型」 可证实的企业云转型战略
  7. 争议 | 两台主机部署 Oracle,采用哪种模式好?
  8. Go语言标准库之time
  9. 科普NA公链(Nirvana):NAC公链采用基于NIO的Netty,实现链上应用百万级

随机推荐

  1. Android简介
  2. Android内核的简单分析
  3. Android中传感器Sensor的使用
  4. Android事件机制之二:onTouch详解
  5. Android中关于线程使用的几点注意事项
  6. android Intents和Intent Filters - 开发
  7. [Android] 输入法的开发
  8. 【Android手机游戏】贪吃蛇(1)
  9. android 4.0.4系统下实现apk的静默安装和
  10. 【源码分享下载】每日更新之Android项目