Navigationdrawer under MapFragment and CameraView

2019-04-15 10:35发布

问题:

I have a bug with the google maps fragment. The fragment is placed inside my activity and when i open the navigation drawer it is displayed behind the maps fragment. that's strange because the navigation drawer is on top of the fragment in the layout.

Same problem with the CameraView.

problem detected on android 2.3 and some

回答1:

Reason: The CameraView and the MapFragment are SurfaceViews.

Solution:

    <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">
        <FrameLayout
                android:id="@+id/palce_map_here"
                android:layout_height="match_parent"
                android:layout_width="match_parent"/>
        <FrameLayout
                android:id="@+id/bugfixview"
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:background="@android:color/transparent"/>
    </RelativeLayout>

draw a transparent view on top of the surface view.