如何禁用 Android 图库中的 fling
我的应用程序中有一个自定义画廊,经过一些测试后,我决定不希望画廊通过手指滑动进行导航。我设置了左右按钮来控制它。现在我想弄清楚如何禁用 onFling
方法。我尝试过 this.setEnabled(false); ,但不起作用,并尝试过 this.setClickable(false);
,但不起作用......也是我的重写的 onFling()
方法具有除 return(true) 之外的所有内容;评论掉了......不知道还能尝试什么!有什么想法吗?
谢谢 :)
I have a custom gallery in my app and after doing some testing I've decided that I don't want the gallery to navigate with finger swipes. I've set up a left and right button to control it instead. Now I want to figure out how to disable the onFling
method. I've tried this.setEnabled(false);
which didn't work, and tried this.setClickable(false);
which didn't work... also my overridden onFling()
method has everything except the return(true); commented out.... not sure what else to try! Any ideas??
Thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
更好的方法(如所述此处)是重写自定义图库类中的 fling 方法:
A better approach (as described here) is to override the fling method in your custom gallery class:
哦,明白了!
在我的自定义画廊类中:
从此处发布的画廊源代码中得出:
http://www.devdaily.com /java/jwarehouse/android/core/java/android/widget/Gallery.java.shtml
:)
Oh, got it!
In my custom gallery class:
Figured that put from the gallery source code posted here:
http://www.devdaily.com/java/jwarehouse/android/core/java/android/widget/Gallery.java.shtml
:)