我想创建一个简单的界面,顶部的MapView
和底部的Button
刷新说MapView
。这两个元素应该fill_parent
在宽度,但我希望他们不重叠在高度。我的问题是我的mapview似乎与我的Button
重叠并隐藏它。这是我的layout.xml
:问题与布局Android
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="my_api_key" />
<Button
android:id="@+id/close"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:text="@string/title_close" />
</LinearLayout>
在此先感谢。
而使用'layout_height = “WRAP_CONTENT”'上的按钮,不要忘记 – 2011-04-11 10:41:32
是的,谢谢。在上次编辑中已经有所改进。 – Olegas 2011-04-11 10:42:40
很好,有帮助。你有没有机会参考教程?除了developer.android.com中的一个 – Syllkons 2011-04-11 10:58:15