在 imageView 上添加按钮
我正在尝试显示一个带有一些按钮的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将 ImageView 和 AbsoluteLayout 放在 FrameLayout。然后将按钮添加到 AbsoluteLayout。
You could put the ImageView and a AbsoluteLayout inside a FrameLayout. Then add your buttons to the AbsoluteLayout.
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.