Android ListView with different layouts for each row

前端 未结 6 1576
独厮守ぢ
独厮守ぢ 2020-11-21 07:09

I am trying to determine the best way to have a single ListView that contains different layouts for each row. I know how to create a custom row + custom array adapter to sup

6条回答
  •  北荒
    北荒 (楼主)
    2020-11-21 08:11

    If we need to show different type of view in list-view then its good to use getViewTypeCount() and getItemViewType() in adapter instead of toggling a view VIEW.GONE and VIEW.VISIBLE can be very expensive task inside getView() which will affect the list scroll.

    Please check this one for use of getViewTypeCount() and getItemViewType() in Adapter.

    Link : the-use-of-getviewtypecount

提交回复
热议问题