我有这样的布局:它应该有一个底部有一个容器的地图视图,这个容器有一个广告和两个按钮,带有黄色背景。相反,我看到的只是屏幕上充满广告的容器和屏幕底部的两个按钮。
xml 的根目录:(不知何故,它没有在 stackoverflow 上显示根目录)
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</RelativeLayout>
XML:
<RelativeLayout
android:id="@+id/bottomcontainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/yellow" >
<LinearLayout
android:id="@+id/action"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_margin="0dp"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:padding="0dp" >
<Button
android:id="@+id/bt_map"
style="@style/ButtonLeft"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:enabled="false"
android:gravity="center"
android:minWidth="100dp"
android:padding="8dp"
android:text="Map" />
<Button
android:id="@+id/list"
style="@style/ButtonRight"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:gravity="center"
android:minWidth="100dp"
android:padding="8dp"
android:text="List" />
</LinearLayout>
<com.google.ads.AdView
android:id="@+id/adview"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_above="@id/action"
ads:adSize="BANNER"
ads:adUnitId="unitId"
ads:loadAdOnCreate="true" />
</RelativeLayout>
<com.google.android.gms.maps.MapView
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:apiKey="apikey"
android:clickable="true"
map:uiZoomControls="false"
android:layout_above="@id/bottomcontainer" >
</com.google.android.gms.maps.MapView>
<ImageButton
android:id="@+id/bt_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_margin="10dp"
android:src="@android:drawable/ic_menu_mylocation" />
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/yellow"
android:layout_above="@id/bottomcontainer"
android:visibility="gone" >
</ListView>