如何创建一个旋转的轮子控制? [英] How To Create a Rotating Wheel Control?

查看:128
本文介绍了如何创建一个旋转的轮子控制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现在Android上的旋转轮,就像图像显示below.I遇到了教程,从这个的链接。但我要实现同样显示在下面的形象。轮由个人images.Does人对本实施方案的任何想法?任何帮助将是AP preciated。

I am trying to implement the Rotatory wheel in android, just like the image displayed below.I came across the tutorial from this link. But i want to implement just as shown in the below image.The wheel consists of individual images.Does anybody have any idea regarding this implementation?? Any help would be appreciated.

在此先感谢。

阿卡什

推荐答案

适用于OnTouchListener通过它我得到了三件大事分别是ImageView的: MotionEvent.ACTION_DOWN MotionEvent.ACTION_MOVE &放大器; MotionEvent.ACTION_UP 。上MotionEvent.ACTION_DOWN得到其中用户触摸和上MotionEvent.ACTION_UP了其中用户releases.After获得两个角度差的角度的角度,旋转该angle.After旋转的图像的图像通过角度检查象限和维持INT根据象限和通过履行其条件递增变量根据int变量的值设置.Maintained单击事件的新的图像(所希望的)。

Applied on OnTouchListener on the imageView through which i got three events namely: MotionEvent.ACTION_DOWN, MotionEvent.ACTION_MOVE & MotionEvent.ACTION_UP. On MotionEvent.ACTION_DOWN got the angle where the users touches and on MotionEvent.ACTION_UP got the angle where user releases.After getting difference of the two angles,rotated the image of that angle.After rotating the image checked the quadrant through angle and maintained int variable which incremented according to the quadrant and by fulfilling the condition set the new image(the desired one).Maintained the click event according to the value of the int variable.

这篇关于如何创建一个旋转的轮子控制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆