【发布时间】:2013-07-31 09:37:43
【问题描述】:
在我的 Android 应用中,我有这样的布局:
<?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:orientation="vertical">
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
class="com.google.android.gms.maps.SupportMapFragment"/>
<Button
android:id="@+id/button_back"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:onClick="CloseActivity"
android:padding="0dp"
android:text="@+string/back" />
</LinearLayout>
在预览和手机上,它看起来像:
正如您在底部区域的按钮上看到的那样,那里有一些填充。
我怎样才能摆脱它,让按钮完全填满底部区域?
【问题讨论】:
-
DATerre 的回答已经正确了两年。可以这样标记吗?
-
这个问题需要编辑以获得更好的标题。它已成为 Google 搜索中的第一个结果,但并没有真正回答问题。