在imageView上添加按钮

时间:2011-06-17 15:07:45

标签: android button android-widget imageview

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

感谢。

2 个答案:

答案 0 :(得分:3)

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

答案 1 :(得分:2)

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