【问题标题】:White blinking when updating map style on iOS在 iOS 上更新地图样式时白色闪烁
【发布时间】:2023-04-03 01:58:01
【问题描述】:

Google 地图显示在屏幕上,地图样式在创建地图时更新为深色主题 (onMapCreated)

问题是样式更改时出现白色闪烁,并且由于黑色主题过渡而非常明显。 (参见视频)

return GoogleMap(
              myLocationButtonEnabled: false,
              zoomGesturesEnabled: false,
              scrollGesturesEnabled: true,
              mapType: MapType.normal,
              circles: circles,
              markers: markers,
              initialCameraPosition: cameraPosition,
              onMapCreated: (GoogleMapController controller) {
                _mapController = controller;
                final currentMapStyle = (_themeType == ThemeType.dark)
                    ? _darkMapStyle
                    : _normalMapStyle;
                _mapController.setMapStyle(currentMapStyle);
              },
            );
          }), 

【问题讨论】:

    标签: ios flutter google-maps-flutter


    【解决方案1】:

    作为一种解决方法,我将地图放在一个堆栈中。

    这个栈里装满了地图和一个容器。

    容器在一小段时间(100 毫秒)后设置为透明。

    【讨论】:

      猜你喜欢
      • 2012-11-18
      • 2017-08-24
      • 1970-01-01
      • 1970-01-01
      • 2012-06-18
      • 1970-01-01
      • 1970-01-01
      • 2014-08-24
      • 1970-01-01
      相关资源
      最近更新 更多