getViewTypeCount and getItemViewType methods of ArrayAdapter

前端 未结 3 1995
后悔当初
后悔当初 2020-11-22 09:32

Can somebody in plain words explain me the usage of getViewTypeCount() and getItemViewType() methods of ArrayAdapter?

3条回答
  •  滥情空心
    2020-11-22 10:21

    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

提交回复
热议问题