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

    今天学习了表格布局的stretchColumns(拉伸列)

    流程:在TableLayout中设置了四个按钮,接着在最外层的TableLayout中添加以下属性: android:stretchColumns = "1"

    设置第二列为可拉伸列,让该列填满这一行所有的剩余空间,代码如下:

    <TableLayout    
        android:id="@+id/TableLayout2"    
        android:layout_width="fill_parent"    
        android:layout_height="wrap_content"    
        android:stretchColumns="1" >    
        
        <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" />                 
        </TableRow>    
    </TableLayout>

    运行效果图:

  • 相关阅读:
    P2764 最小路径覆盖问题
    P1402 酒店之王 网络流
    P2597 [ZJOI2012]灾难 拓扑排序
    FJOI2017 矩阵填数
    2019.2.27模拟
    2019.2.26模拟
    SDOI2013 方程
    [AH2017/HNOI2017]抛硬币
    Lucas定理和扩展Lucas定理
    LuoguP4861 按钮
  • 原文地址:https://www.cnblogs.com/lxywsx/p/14905762.html
Copyright © 2011-2022 走看看