Commit 903efe81 authored by Qiu Xiang's avatar Qiu Xiang

修正自定义信息窗体显示问题

parent 43d80ae7
......@@ -19,7 +19,7 @@ internal class AMapMarkerManager : ViewGroupManager<AMapMarker>() {
override fun addView(marker: AMapMarker, view: View, index: Int) {
when (view) {
is AMapInfoWindow -> marker.infoWindow = view as ReactViewGroup
is AMapInfoWindow -> marker.infoWindow = view
is AMapOverlay -> marker.setIconView(view)
}
}
......
......@@ -80,13 +80,13 @@ class AMapView(context: ThemedReactContext) : MapView(context) {
}
map.setInfoWindowAdapter(object : AMap.InfoWindowAdapter {
private val paddingTop = context.resources.displayMetrics.density
val paddingTop = context.resources.displayMetrics.density
override fun getInfoWindow(marker: Marker): View {
return markers[marker.id]?.infoWindow as View
override fun getInfoWindow(marker: Marker): View? {
return markers[marker.id]?.infoWindow
}
override fun getInfoContents(marker: Marker): View {
override fun getInfoContents(marker: Marker): View? {
val layout = LinearLayout(context)
layout.orientation = LinearLayout.VERTICAL
val titleView = TextView(context)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment