我想要設計帶Google地圖和頁腳的屏幕。使用頁腳,我將它與不同的xml佈局文件分開,並使用'包括'標籤。問題是覆蓋地圖的頁腳。下面描述了我的xml佈局文件。帶有頁腳的Android地圖片段
map_viewer.xml
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/layout_mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@id/actionBtn"
android:layout_marginTop="5dp">
<fragment
xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
map:uiRotateGestures="false"
class="com.glympsefunctionalitydemo.maps.Map"/>
<RelativeLayout
android:id="@+id/footer_map"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<include layout="@layout/footer/>"
</RelativeLayout>
</RelativeLayout>
footer.xml
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@null">
<ImageButton
android:id="@+id/actionBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:background="@null"
android:src="@drawable/btn_actions"/>
<ImageButton
android:id="@+id/mapBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/footer_horizontal_margin"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:background="@null"
android:src="@drawable/btn_map"/>
<ImageButton
android:id="@+id/mapBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/footer_horizontal_margin"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:background="@null"
android:src="@drawable/btn_settings"/>
</RelativeLayout>
</merge>
地圖通吃的空間,頁腳疊加的地圖。但我只想讓地圖在顯示頁腳時留下空間。我如何得到它的工作。
顯示你的代碼。 – keshav
對不起,keshav,我貼的代碼。謝謝! – pqtuan86
你爲什麼使用FrameLayout?有必要嗎 ? – keshav