• android布局之线性布局


    LinearLayout 线性布局有两种,分别是水平线性布局和垂直线性布局,LinearLayout属性中android:orientation为设置线性布局当其="vertical"时,为 垂直线性布局,当其="horizontal"时,为水平线性布局,不管是水平还是垂直线性布局一行(列)只能放置一个控件。

    下面我们举例说明:

    垂直线性布局

    <?xml version="1.0" encoding="utf-8"?>  
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
            android:layout_width="match_parent"  
            android:layout_height="match_parent"  
            android:orientation="vertical" >  
          
            <EditText   
                android:layout_width="100dp"  
                android:layout_height="wrap_content"  
                  
                />  
              
            <Button   
                android:layout_width="100dp"  
                android:layout_height="wrap_content"  
                android:text="Button1"/>  
          
            <Button   
                android:layout_width="100dp"  
                android:layout_height="wrap_content"  
                android:text="button2"/>  
          
        </LinearLayout> 


    运行的结果:

    水平线性布局:

    <?xml version="1.0" encoding="utf-8"?>  
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
            android:layout_width="match_parent"  
            android:layout_height="match_parent"  
            android:orientation="horizontal" >  
              
            <EditText   
                android:layout_width="100dp"  
                android:layout_height="wrap_content"  
                />  
              
            <Button   
                android:layout_width="100dp"  
                android:layout_height="wrap_content"  
                android:text="Button1"/>  
          
            <Button   
                android:layout_width="100dp"  
                android:layout_height="wrap_content"  
                android:text="button2"/>  
          
        </LinearLayout>  


    运行结果:

  • 相关阅读:
    screenonclick类
    凶残
    接近毁灭的状态
    在python3中,items()进行了优化
    python中两个字典(dict)合并
    Python代码中os.path常见属性的相关介绍 from 路人甲
    什么是pyc文件
    wget
    Python的字典的items(), keys(), values()
    利用securecrt在linux与windows之间传输文件
  • 原文地址:https://www.cnblogs.com/snake-hand/p/3178029.html
Copyright © 2020-2023  润新知