简体   繁体   English

将图像按钮放在Android上的图像背景上

[英]place image button over the image background on android

in my app i have a background image and need to place an image button at the specified location of the background image.i did by using frame layout with android:layout_gravity , layout_alignBottom and marginLeft and right properties. 在我的应用程序中,我有一个背景图像,需要在背景图像的指定位置放置一个图像按钮。我通过使用具有android:layout_gravitylayout_alignBottommarginLeft and right属性的框架布局来android:layout_gravity layout_alignBottom marginLeft and right please refer image no :1 请参考图片编号:1

i set it for one emulator and it works but i get wrong when launch other emulator of different size so how to set image view over a background image so that imageview not changes its position for any size of screen. 我为一个模拟器设置了它,但是它起作用了,但是在启动另一个不同大小的模拟器时却出错了,因此如何在背景图像上设置图像视图,以使imageview在任何大小的屏幕上都不会改变其位置。

Is there any possibilities to trigger action find by touching image button on the screen(both background image and image button combined as single image - please refer Image no 2) 触摸屏幕上的图像按钮是否有可能触发动作查找(背景图像和图像按钮都合并为单个图像-请参阅图像2) 在此处输入图片说明在此处输入图片说明

For this kind of problem, I would think that the best solution in order not to have problem with the screen sizes/densities would be to have different images for the play phase, stop etc. 对于这种问题,我认为为了避免屏幕尺寸/密度出现问题,最好的解决方案是在播放阶段,停止播放等过程中使用不同的图像。

Thus having: microphone with play button: 1 image microphone with stop button: 1 image microphone with play selected button: 1 image 因此具有:带播放按钮的麦克风:1个具有停止按钮的麦克风:1个具有播放选择按钮的麦克风:1个图像

Etc. and handling the user events. 等和处理用户事件。

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM