【发布时间】:2020-04-01 21:40:19
【问题描述】:
Mapbox Mapview 在 Mapview 被渲染之前显示一个白屏闪烁。闪光灯会停留大约 500 毫秒,之后会显示地图。我在运行时将 Mapview 动态添加到我的 FrameLayout((addView())。下面是代码 sn-p。请帮助!
private fun initializeMapBoxMap() {
val mapView = MapView(context) // create new mapview
innerLayout.addView(mapView) // add mapView to the FrameLayout
mapView.getMapAsync { mapboxMap ->
// white screen shown at this point for 500 ms
mapboxMap.setStyle(Style.DARK) {
// white screen gone at this point
}
}
}
截图链接:screenshot link
【问题讨论】:
-
白屏出现在模拟器还是物理设备上?如果您只在模拟器上看到过这种情况,我建议您在物理设备上也进行测试,因为与实际硬件相比,模拟器性能是次优的。
标签: android android-layout mapbox android-mapview mapbox-android