Android_ experience _ continue to add small experiment in ......

1, the width of the control layout displayed percentage LineLayout

Wherein the control width = percentage weight / weight of all the controls where the parent and

<LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        <Button
            Android: layout_width = "0dp"    // width 0dp
            android:layout_height="fill_parent"
            android:layout_weight="1"    //设置权重
            android:text="1"/>
    </LinearLayout>

 

Guess you like

Origin www.cnblogs.com/LieYanAnYing/p/12006655.html