安卓ui MXL布局示例

    技术2024-09-26  47

    演示代码:

    1 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 xmlns:tools="http://schemas.android.com/tools" 3 android:layout_width="match_parent" 4 android:layout_height="match_parent" 5 tools:context=".MainActivity" android:orientation="horizontal" android:gravity="bottom"> 6 <Button 7 android:layout_weight="1" 8 android:text="button" 9 android:layout_width="wrap_content" 10 android:layout_height="wrap_content"/> 11 <Button 12 android:text="button" 13 android:layout_gravity="top" 14 android:layout_weight="1" 15 android:layout_width="wrap_content" 16 android:layout_height="wrap_content"/> 17 <Button 18 android:text="button" 19 android:layout_weight="1" 20 android:layout_width="wrap_content" 21 android:layout_height="wrap_content"/> 22 </LinearLayout>

    演示结果:

    Processed: 0.050, SQL: 9