zoukankan      html  css  js  c++  java
  • 寒假学习day17

    今天了解了表格布局中的三个常用属性。

    android:collapseColumns:设置需要被隐藏的列的序号
    android:shrinkColumns:设置允许被收缩的列的列序号
    android:stretchColumns:设置运行被拉伸的列的列序号

    以上这三个属性的列号都是从0开始算的,比如shrinkColunmns = "2",对应的是第三列!
    可以设置多个,用逗号隔开比如"0,2",如果是所有列都生效,则用"*"号即可
    除了这三个常用属性,还有两个属性,分别就是跳格子以及合并单元格,这和HTML中的Table类似:

    android:layout_column="2":表示的就是跳过第二个,直接显示到第三个格子处,从1开始算的!
    android:layout_span="4":表示合并4个单元格,也就说这个组件占4个单元格

    属性使用示例:

    ①collapseColumns(隐藏列)

    流程:在TableRow中定义5个按钮后,接着在最外层的TableLayout中添加以下属性: android:collapseColumns = "0,2",就是隐藏第一与第三列,代码如下:

    <TableLayout  
        android:id="@+id/TableLayout2"  
        android:layout_width="fill_parent"  
        android:layout_height="wrap_content"  
        android:collapseColumns="0,2" >  
    
        <TableRow>  
    
            <Button  
                android:layout_width="wrap_content"  
                android:layout_height="wrap_content"  
                android:text="one" />  
    
            <Button  
                android:layout_width="wrap_content"  
                android:layout_height="wrap_content"  
                android:text="two" />  
    
            <Button  
                android:layout_width="wrap_content"  
                android:layout_height="wrap_content"  
                android:text="three" />  
    
            <Button  
                android:layout_width="wrap_content"  
                android:layout_height="wrap_content"  
                android:text="four" />  
    
            <Button  
                android:layout_width="wrap_content"  
                android:layout_height="wrap_content"  
                android:text="five" />  
        </TableRow>
    </TableLayout>

    运行效果图:

  • 相关阅读:
    js网页滚动条滚动事件实例分析
    一个简单的登陆注册的页面
    几个例子弄懂JS 的setInterval的运行方式
    IIS线程池与ASP.NET线程池
    [翻译]了解ASP.NET底层架构(八)
    IIS提示Server Application Unavailable
    C/C++, Java和C#的编译过程解析
    C#学习系列-.NET体系结构
    C#技术漫谈之垃圾回收机制(GC)
    ASP.NET应用程序与页面生命周期
  • 原文地址:https://www.cnblogs.com/lxywsx/p/14905697.html
Copyright © 2011-2022 走看看