在 imageView 上添加按钮

发布于 2024-11-16 02:28:57 字数 98 浏览 3 评论 0原文

我正在尝试显示一个带有一些按钮的 imageView 。 我的问题是我找不到任何方法在图像上的特定 x 和 y 处添加按钮,你能告诉我一个函数来做到这一点吗?

谢谢。

I'm trying to display an imageView with some buttons on it.
My problem is that I don't find any way to add my buttons at a specifics x and y on the image, can you tell me a function to do that?

Thanks.

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

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

发布评论

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

评论(2

倾城花音 2024-11-23 02:28:57

您可以将 ImageView 和 AbsoluteLayout 放在 FrameLayout。然后将按钮添加到 AbsoluteLayout。

You could put the ImageView and a AbsoluteLayout inside a FrameLayout. Then add your buttons to the AbsoluteLayout.

苦妄 2024-11-23 02:28:57

ImageView 中不能包含子对象。 ImageView 和 Button 必须是布局中的两个子对象。如果您希望按钮显示在 ImageView 的顶部,请将按钮的代码放在布局中 ImageView 代码的后面。

An ImageView is not capable of having children objects within it. The ImageView and Buttons would have to be two child objects within a Layout. If you want the button to appear on top of the ImageView, place the code for the Button after the ImageView code in the layout.

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