滚动图库的按钮
在我的应用程序中,我有一个 Gallery
视图和两个用于滚动它的按钮 - 向左和向右。通过 fling 滚动图库也可以,但问题是:在用户使用 fling 移动滚动 Gallery
后,如何更新按钮的状态?是否有任何回调告诉 Gallery
的所选项目已更改?谢谢。
In my application I have a Gallery
view and two buttons to scroll it - left and right. Scrolling the gallery by fling also works, and here is the problem: how can I update the states of buttons after the user scrolled the Gallery
using fling movements? Is there any callback that tells that Gallery
's selected item has changed? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一个 onItemSelectedListener 可以与图库一起使用。如果您使用它,您可能还想阅读有关 setCallbackDuringFling() 可以在滑动时启用/禁用侦听器。
There is an onItemSelectedListener that you can use with a gallery. If you use it you'll probably also want to read about setCallbackDuringFling() that can enable/disable the listener while flinging.