Android 通过叠加视图控制MapFragment
我有一个如下的布局Android 通过叠加视图控制MapFragment,android,scrollview,android-view,supportmapfragment,Android,Scrollview,Android View,Supportmapfragment,我有一个如下的布局 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:id="@+id/sliding_pane_container" android:layout_width="match_parent" android:layout_height="ma
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:id="@+id/sliding_pane_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="240dp"
android:id="@+id/map" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/root_container"
android:paddingTop="240dp" />
</ScrollView>
</FrameLayout>
在MapFrameLayout中,我有一个MapFragment,它被scrollview有效地覆盖。我想让scrollview内容在它上面滚动,所以我把它放在片段的顶部。也有填充,使地图最初可见。。
问题是我无法通过叠加视图与地图交互。我试图对scrollview进行子类化,并覆盖onInterceptTouchEvent()
方法,但它仍然不起作用。有什么想法可以解决这个问题吗?谢谢