您的位置:首页 > 移动开发 > Android开发

Android 线性布局

2016-06-18 17:06 274 查看
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:tools="http://schemas.android.com/tools"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:orientation="vertical">

    <Button

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:text="按钮1" />

    <Button

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:text="按钮2" />

    

    <LinearLayout

        android:layout_width="match_parent"

        android:layout_height="match_parent"

        android:orientation="horizontal"

        android:weightSum="3"

        >

            <Button

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_weight="2"

        android:text="按钮3" />

    <Button

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_weight="1"

        android:text="按钮4" />

    

      <Button

          android:visibility="gone"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        

        android:text="按钮5" />

        

    </LinearLayout>

</LinearLayout>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Android 布局