This is basically solved. Since PinnedHeaderListView inherits from ListView, there is a setSelection method in ListView. Solution: Traverse the data sourceList, generate aArrayList positionListcorresponding to the structure of PinnedHeaderListView (for distinction, it can be regarded as sectionpositionList.add(1), when it is an ordinary list elementpositionList.add(0)), and then add the position where the data is "1" Go to anotherArrayList sectionPositionsand callonClick()in the(你的ListView名称).setSelection(sectionPositions.get(i))event of the menu list. The sliding animation effect has not been implemented, and I don’t know much about it yet.
This is basically solved. Since PinnedHeaderListView inherits from ListView, there is a setSelection method in ListView.
Solution:
Traverse the data source
List
, generate aArrayList positionList
corresponding to the structure of PinnedHeaderListView (for distinction, it can be regarded as sectionpositionList.add(1)
, when it is an ordinary list elementpositionList.add(0)
), and then add the position where the data is "1" Go to anotherArrayList sectionPositions
and callonClick()
in the(你的ListView名称).setSelection(sectionPositions.get(i))
event of the menu list.The sliding animation effect has not been implemented, and I don’t know much about it yet.