NullPointerException when using RelativeLayout as custom InfoWindow

前端 未结 3 2036
自闭症患者
自闭症患者 2020-12-23 21:51

I\'m trying to use a RelativeLayout as custom InfoWindow for my markers, but a I get a NullPointerException every time showInfoW

3条回答
  •  佛祖请我去吃肉
    2020-12-23 22:42

    I had this problem and was able to fix it by adding

    view.setLayoutParams(new ViewGroup.LayoutParams(desiredWidth,desiredHeight));
    

    to the view before returning it from InfoWindowAdapter.getInfoWindow

提交回复
热议问题