android相对布局
16lz
2021-12-04
相对布局
效果图:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_height="fill_parent" android:layout_width="fill_parent" android:padding="5dp" android:gravity="center_horizontal" // 上面gravity属性的参数:center为居中,center_horizontal为水平居中,center_vertical为垂直居中 > <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_width="60dp" android:layout_height="wrap_content" android:text="@string/number" android:id="@+id/numberlabel" android:layout_marginTop="5dp"/> <EditText android:inputType="number" android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/number" android:labelFor="@id/number" android:layout_toRightOf="@id/numberlabel" android:layout_marginLeft="5dp" /> </RelativeLayout> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/content" /> <EditText android:inputType="textMultiLine" android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/content" android:labelFor="@id/content" android:minLines="3" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button" android:text="@string/button" /></LinearLayout>
效果图:
更多相关文章
- Android(安卓)设置虚线分割线
- android布局属性详解
- ImageVIew 设置图片大小
- RelativeLayout属性详解
- 设置TextView文字居中
- Android(安卓)众多的布局属性详解
- Android(安卓)众多的布局属性详解
- LinearLayout布局实现垂直水平居中
- android:scaleType、android:layout_alignBottom、layout_below