Moving MapFragment (SurfaceView) causes black background flickering

后端 未结 16 1388
误落风尘
误落风尘 2020-12-04 09:32

I\'m trying to implement new Android Google Maps API (v2). However it doesn\'t seem to go well with SlidingMenu. As you may know, MapFragment implementation is

相关标签:
16条回答
  • 2020-12-04 09:57

    I got same problem with a webview and SlidingMenu and I solved by modifying SlidingMenu source code as explained here by main developer.

    Comment out the hardware acceleration in the manageLayers method of SlidingMenu. This seems to be the only solution since SurfaceViews don't work.

    0 讨论(0)
  • 2020-12-04 09:59

    add android:hardwareAccelerated="true" in your manifest file.

    eg: <application android:name=".Sample" android:hardwareAccelerated="true" />

    0 讨论(0)
  • 2020-12-04 10:00

    To prevent the MapView(it is actually a SurfaceView) creating the black holes, I add a empty view with transparent background color to cover the whole MapView, such that it can prevent MapView from generating a black "hole". It may work for your situation.

    0 讨论(0)
  • 2020-12-04 10:05

    This worked for me... Add map:zOrderOnTop="true" to your fragment as this...

    <fragment
                    android:id="@+id/map"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:name="com.google.android.gms.maps.SupportMapFragment""
                    map:zOrderOnTop="true"/>
    

    Remember to add this to your parent ScrollView

    xmlns:map="http://schemas.android.com/apk/res-auto"
    
    0 讨论(0)
提交回复
热议问题