Android - 如何阻止用户与图库交互
好的,我知道这个问题一开始听起来很奇怪,因为画廊被设计为用户交互,但是,我喜欢画廊功能,因为它满足我的很多需求。即我可以给它一些图片,将它们从右到左或从左到右移动,并在选择其中一张图片时为它们添加动画(在我的例子中是缩放)。所以一切都好。
我只需要以编程方式进行选择,我目前正在工作。我只是不希望用户能够自己滑动、滚动、选择、长按等。因此不需要用户交互。
那么,我怎样才能阻止用户做这些事情,而无需自己编写图库功能(并且不会砍掉用户的手指!)。
谢谢。
OK, I know this questions sounds weird at first, as GALLERY is designed to be user interactive, but, I like the Gallery functionality, as it suits a lot of my needs. i.e. I can give it a number of pictures, move the whole of them from right to left, or left to right and get them an animate (in my case, zoom) when one of them is selected. So all good.
I just need to do the selection programatically, which I currently have working. I just don't want the user to be able to fling, scroll, select, longpress, etc. by themselves. So no user interaction is required.
So, how can I prevent a user from doing theses things, without writting a gallery function myself (and without chopping a users fingers off!).
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试将图库视图的
clickable
和focusable
属性设置为false
。Try setting the
clickable
andfocusable
properties of your Gallery View tofalse
.以下对我有用:
如果仍然留下一些互动,您也可以尝试:
Following worked for me:
If some interaction is still left you can also try: