Android:如何更改每次触摸的图像
我想在用户每次触摸屏幕时更改图像。我想让用户点击屏幕,图像每次都会发生变化,并且在第五次触摸时,它会循环回带有添加文本的原始图像。
我看过
我已经尝试过 IUevents 和 StateListdrawable。我不知道如何在每次触摸后实际更改图像(屏幕上的任何位置)。
I would like to change an image each time the user touches the screen. I would like to have user tap the screen and the image changes each time and at the 5th touch it would loop back to the original image with added text.
I have looked at
How would I set an ImageButton to change only when my finger is touching it
I have tried both IUevents and StateListdrawable. I couldn't figure out how to actually change the image after each touch (anywhere in the screen).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为什么不能使用普通的ImageView呢?这样做:
And why can't you use the normal ImageView? Do this:
您需要创建扩展 ImageView 的自定义类,现在将此 imageview 显示到整个屏幕。
you need to create the Custom class which extends the ImageView now display this imageview to whole screen.