在Android中将图像定位在具有特定坐标的图像之上

发布于 2025-01-01 22:07:12 字数 247 浏览 3 评论 0原文

最终目标:让速度计式指针根据测试结果在表盘上移动。

当前问题:目前,我已使用 FrameLayout 将针作为单独的图像放置在快速拨号的顶部。我一直在网上寻找一种用坐标定位针的方法,这样我就可以将它精确地放置在表盘上我想要的位置。我想发布一张图片,但我是论坛新手,我不被允许!

简而言之,我可以将一个图像定位在另一个具有精确坐标的图像上(允许旋转等)吗?我解决问题的方法正确吗?

End Goal: Getting a speedometer style needle to move around a dial according to test results.

Current Issue: At the moment I have placed the needle on top of the speed dial as a sperate image using FrameLayout. I have been scouring the web for a way to position the needle with coordinates so I can have it exactly where I want it on the dial. I would post an image but I'm new to the forum and I'm not allowed!

So in short can I position an image over another image with exact coordinates (allowing for rotation etc)? Am I going the right way about solving my problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

你在看孤独的风景 2025-01-08 22:07:12

AbsoluteLayout,它让您使用绝对位置,但不建议您使用

相反,您应该创建自己的视图扩展,以绘制表盘和指针。有关这方面的更多信息,请查看 Maurycy 的评论,该评论推荐 这部分手册

There is the AbsoluteLayout, which lets you use absolute positions, but it is not recommended that you use it.

Instead, you should create your own extension of a View, that draws your dial and needle. For more info on this, look at Maurycy's comment, which recommends this part of the manual.

土豪我们做朋友吧 2025-01-08 22:07:12

计算测量值并相应地旋转指示器的图像。

Calculate measurements and rotate image of indicator accordingly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文