MapFragment gets a dark overlay when used in DialogActivity

前端 未结 5 1118
故里飘歌
故里飘歌 2020-12-24 08:39

I\'m trying to show a MapFragment of the Android Maps v2 API in an Activity with the @android:style/Theme.DeviceDefault.Light.Di

5条回答
  •  醉梦人生
    2020-12-24 09:04

    I got the same problem. After some research, I found two hacks :

    • Add this param for your theme in the styles.xml :
      false

    Bad part : it removes the black overlays behind the activity.

    • Set the z order on the top for the map object :
      GoogleMapOptions googleMapsOptions = new GoogleMapOptions();
      googleMapsOptions.zOrderOnTop( true );
      MapFragment mapFragment = MapFragment.newInstance(googleMapsOptions);

    Bad part : The map is above the Zoom control and MyLocation button.

    Personnaly, I choose the first solution.
    Hope this help !

    Link to the source

提交回复
热议问题