Android 车速表(针表)
创建一个简单的应用程序,计算您的行驶速度并将其显示在速度计图形中。我可以进行所有速度计算、GPS 计算等。但我对动画不太确定。除了温度计的例子之外,还有人有关于针规的任何好的教程或例子吗?
Creating a simple app that calculates the speed your going and displays it in a speedometer graphic. I can do all the speed calculations, gps calculations etc.. but i am not too sure about the animation. Does anyone have any good tutorials or examples on needle gauges other than the thermometer example out there?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我知道,这个帖子很旧了。但我也遇到了同样的情况:没有很好的控制来表示速度。我想很多人都面临过这个问题。
我自己实现了 SpeedometerView:一个带有指针和彩色值范围的简单速度计。放心下载!
https://github.com/ntoskrnl/SpeedometerView
此控件已在我的应用程序中使用 CardioMood。
该代码未优化,但可以运行。享受!
I know, the post is quite old. But I had the same situation: there is no a good control for representing speed. I guess many people are facing this.
I've implemented SpeedometerView myself: a simple speedometer with needle and colored value ranges. Feel free to download!
https://github.com/ntoskrnl/SpeedometerView
This control was used in my app CardioMood.
The code is not optimized, but works. Enjoy!
检查这里。这是我的代码。如果您有任何疑问,请告诉我。
访问 https://github.com/mucahitsidimi/GaugeView
您可以简单地将 Gauge 实现到您的项目中。
您可以根据需要设置宽度和高度。它会自动计算一切。
Check here. It is my code. If you have any question please let me know.
Visit https://github.com/mucahitsidimi/GaugeView
You can implement Gauge to your project simply.
You can set width and height what ever you want to. It will calculate everything automatically.
检查我找到的解决方案我的情况。
非常感谢店主 Evelina Vrabie...
Check the solution i found for my case.
Big thanks to the owner Evelina Vrabie...
您可能可以从 this< /a>.
然后,当在值之间转换时,制作一个动画,其中指针每单位时间逐渐移动到下一个值 X 单位。
这个问题也与您的问题非常相似。
You could probably start with something like this.
Then when transitioning between values, do an animation where the needle gradually moves to the next value X units per unit of time.
This question is also very similar to yours.