Android学习笔记之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" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="120dp"
        android:layout_height="wrap_content"
        android:scrollHorizontally="true"
        android:text="Large Text"
        android:layout_weight="1"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
         android:layout_weight="1"
        android:text="Button" />

</LinearLayout>

 android:layout_weight="1"分割界面比例

原文地址:https://www.cnblogs.com/wuhailong/p/5252006.html