Google Maps Lite Mode causes jank in RecyclerView

前端 未结 6 1815
囚心锁ツ
囚心锁ツ 2020-12-07 11:31

I have a RecyclerView which is a vertical scrolling list of items. Each list item contains a Google Maps V2 MapView in Lite Mode. I\'m taking advantage of this

6条回答
  •  自闭症患者
    2020-12-07 12:27

    I have removed this Override method because every time this gives empty map when testing and it works perfectly in my recyclerView.

    @Override 
    public void onViewRecycled(ViewHolder holder) 
    {
      // Cleanup MapView here?
      if (holder.gMap != null) 
      {
          holder.gMap.clear();
          holder.gMap.setMapType(GoogleMap.MAP_TYPE_NONE);
      }
    }
    

    You can try it if above code does not work in your case as well.

提交回复
热议问题