Ore*_*reo 1 xml android android-layout android-linearlayout
尝试使用LinearLayout在底部对齐按钮,但是在TextView下面.
要在底部设置按钮,我正在使用android:layout_gravity="bottom"但仍未完成
LinearLayout xml
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_gravity="bottom"
android:layout_height="wrap_content">
<Button
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="Bottom" />
</LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
将第二个线性布局更改为
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal" >
Run Code Online (Sandbox Code Playgroud)
这将按钮放在底部,此布局将占用剩余的空间
| 归档时间: |
|
| 查看次数: |
17384 次 |
| 最近记录: |