You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Google Maps Android SDK卫星视图道路半透明问题求助

问题详情

在对话框中展示SupportMapFragment,当地图类型设置为卫星影像时,道路呈现半透明状态并显示后台Activity。该问题仅出现在Pixel 6 Pro(Android 14)设备上,Pixel 4XL(Android 13)无此问题,且放大到极高层级后问题消失。已尝试为FragmentContainerView设置背景但无效。

相关代码

布局代码

<androidx.fragment.app.FragmentContainerView
        android:id="@+id/map"
        android:name="com.google.android.gms.maps.SupportMapFragment"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:background="@android:color/black"/>

onCreateDialog()中的地图初始化代码

mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map);
if (mapFragment == null) {
    mapFragment = SupportMapFragment.newInstance();
    getChildFragmentManager().beginTransaction().add(R.id.map, mapFragment).commit();
}

问题截图

道路半透明显示后台Activity

内容的提问来源于stack exchange,提问作者Flyview

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.21 08:17:02