zoukankan      html  css  js  c++  java
  • Android随笔

    本节学习路线图

    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>

    运行效果图:

  • 相关阅读:
    2017python学习的第四天,生成器,装饰器迭代器
    2017python第三天作业
    2017python学习的第三天函数
    2017python学习的第三天文件的操作
    2017python第二天作业
    python第二天学了列表,字典和嵌套
    [Translation] Introduction to ASP.NET Core
    Create a private nuget server
    Cunningham's Law
    [转]Migrating HTTP handlers and modules to ASP.NET Core middleware
  • 原文地址:https://www.cnblogs.com/wrx166/p/14909444.html
Copyright © 2011-2022 走看看