zoukankan      html  css  js  c++  java
  • Gridview的stretchMode详解附自动宽度

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

      

     

  • 相关阅读:
    Flask--目录
    Linux相关目录
    Mac 提示错误”xcrun: error“
    subprocess模块
    压缩模块
    GitPython模块
    Ansible-ansible命令
    YAML语法
    Ansible-安装
    Ansible-概念
  • 原文地址:https://www.cnblogs.com/leihupqrst/p/3777079.html
Copyright © 2011-2022 走看看