This is basically solved. Since PinnedHeaderListView inherits from ListView, there is a setSelection method in ListView.
Solution:
Traverse the data source List<Dish>, generate a ArrayList<Integer> positionList corresponding to the structure of PinnedHeaderListView (for distinction, it can be regarded as section positionList.add(1), when it is an ordinary list element positionList.add(0)), and then add the position where the data is "1" Go to another ArrayList<Integer> sectionPositions and call onClick() 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<Dish>
, generate aArrayList<Integer> 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<Integer> 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.