如何为 UI 创建手势控制的旋转图像
我正在尝试找出使图像旋转的最佳方法 用户用手指向左或向右拖动它。我想尝试 将用户手指移动的速率与图像移动的速率相匹配 旋转。
我已经完成了应用程序的基本设置,包括菜单和 我想要什么,这一切都在模拟器上运行得很好, 我只是不确定如何处理这部分。
我可以编写应用程序所需的所有逻辑,但我只是做得不好 设计UI时,我脑子里有一张图片,我实际上做了一个 几个模拟图像,我只是不知道如何让它继续下去 在 Android 中,任何帮助将不胜感激。
I'm trying to figure out the best way to make an image rotate along
with a user's finger dragging it left or right. I want to try and
match the rate a user's finger is moving with the rate the image is
rotating.
I've got the basic setup for my application going, with the menus and
whatnot I want to have, and that's all running great on the emulator,
I'm just not sure how to approach this part.
I can code all the logic I need for my app, I'm just not doing to well
designing the UI, I have a picture in mind, I've actually made a
couple mock images of it, I just can't figure out how to get it going
in Android, and any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议您首先查看:
http://developer。 android.com/guide/topics/ui/ui-events.html
我不太确定如何解决现实生活中的旋转问题,但似乎 OpenGL 可能会帮助你。
http://developer.android.com/guide/topics/graphics/opengl.html
或者也许可以通过自定义动画解决方案?
http://developer.android.com/guide/topics/graphics/animation.html ( => http://developer.android.com /guide/topics/graphics/prop-animation.html )
告诉我们,你是如何解决的!
I'd suggest you to look at first at:
http://developer.android.com/guide/topics/ui/ui-events.html
I am not really sure how to solve the problem with the real-life rotation but it seems OpenGL might help you.
http://developer.android.com/guide/topics/graphics/opengl.html
or maybe a solution through custom animations is possible?
http://developer.android.com/guide/topics/graphics/animation.html ( => http://developer.android.com/guide/topics/graphics/prop-animation.html )
Tell us, how you solved it!