Android开发布局 案例一

权重:就是在布局界面中所占的比例

实践案例:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    >
  <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_weight="1"
      android:background="#f47920">
  </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:background="#2a5caa">
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:background="#faa755">
    </LinearLayout>
</LinearLayout>

 

 

 

 

 

猜你喜欢

转载自blog.csdn.net/weixin_44893902/article/details/108682818