扫码关注官方订阅号
现在要通过item的信息,使ListView定位到该item的位置,如何实现?
走同样的路,发现不同的人生
smoothScrollToPosition(int position) Smoothly scroll to the specified adapter position. // 滑动到适配器指定位置 setSelection(int position) Sets the currently selected item. // 设置当前选中位置
如果单纯的定位到指定位置,试试第一个方法
listView.setSelection(position);
position即你想要定位的item的位置。
position
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
如果单纯的定位到指定位置,试试第一个方法
position即你想要定位的item的位置。