简体   繁体   中英

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. please refer image no :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.

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) 在此处输入图片说明在此处输入图片说明

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

Etc. and handling the user events.

Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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