Android开发

5、控件的布局方法:

线性布局的使用方法

垂直方向:

<?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:background="#000"
android:orientation="vertical">

<Button
android:id="@+id/btn1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="btn1"
android:textAllCaps="false" />

<Button
android:id="@+id/btn2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="btn2"
android:textAllCaps="false" />

<Button
android:id="@+id/btn3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="btn3"
android:textAllCaps="false" />

</LinearLayout>
垂直方向效果图:


 

 

posted @ 2022-05-17 17:37  萧贾jzm  阅读(5)  评论(0编辑  收藏  举报
//歌单id