AddHeaderView and addheaderview of ListView
Using the listView. addHeaderView (...) method in the code, you can add other components above the ListView component and link them together to form a new component. If you use. addHeaderView (...) for multiple times, the first component to be added is listed at the top of the list in the order of addition.
In this case, the position = 0 of the listView corresponds to view1, instead of the first in the original listView.
To make invisible settings for the original ListView, you can use the method of setting the data in the listView adapter to be empty and restore the data when it is visible, for example:
-- Hide ListView --
MStaffAdapter. mDataList = new ArrayList <Map <String, Object> ();
MStaffAdapter. notifyDataSetChanged ();
-- Expand ListView --
MStaffAdapter. mDataList = mStaffDataList; // mStaffDataList is the original cache data.
MStaffAdapter. notifyDataSetChanged ();