【发布时间】:2018-09-04 11:00:18
【问题描述】:
我在谷歌地图上方添加了一个布局,我自己的布局具有透明背景。现在,当我添加它时,我无法在我的应用程序中移动谷歌地图,因为它上面有一个框架布局。我的要求是我希望我的谷歌地图能够像滑动缩放一样工作,即使我上面有 Framelayout 也是如此。
下面是示例代码
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.googlemapactivity.GoogleMapMainActivity" />
<FrameLayout
android:id="@+id/frameTop"
android:layout_above="@+id/llBottomButtom"
android:layout_width="match_parent"
android:descendantFocusability="beforeDescendants"
android:layout_height="match_parent"/>
<LinearLayout
android:id="@+id/llBottomButtom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:weightSum="90">
<Button
android:id="@+id/btnOne"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Route" />
<Button
android:id="@+id/btnTwo"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Current" />
<Button
android:id="@+id/btnThree"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Charge" />
</LinearLayout>
</RelativeLayout>
这里支持地图片段不滑动移动什么的。有相同的解决方案吗?
【问题讨论】:
标签: android google-maps google-maps-api-2