1

I need to put image to another image in to the certain position. For example, the first image has resoluiton 1024x768 and I need to put image the second image in position x = 600 and y = 400. Also, I need to change this position by user's choice, for example, for choice A (from spinner) is position XX and for choice B is position XY. Any idea? Thanks for your reply.

buci
  • 15
  • 1
  • 2

1 Answers1

1

You can use FrameLayout. Just put bigger image below smallest. And for small image change margins by user choice.

Here you can find technique how to change margins:

Change the Right Margin of a View Programmatically?

Community
  • 1
  • 1
olegr
  • 1,999
  • 18
  • 23
  • thanks for your reply. I'm beginner in Android programming, so I don't know how to do it. I tried this code but I'm not able to run it correctly. – buci Mar 10 '15 at 12:31
  • Can you write some code in Java + XML for two pictures and the second picture will be displaced for 100px from left and 100px from top? Also, I don't know, if your soluiton is correct for me - if I have one 7" tablet and one 3,5" smartphone, image will have same size so it will not fit correctly - or not? Thanks – buci Mar 10 '15 at 12:38
  • I suggest you to start coding. Here you can find a good step by step tutorial: http://examples.javacodegeeks.com/android/core/widget/framelayout/android-framelayout-example/ – olegr Mar 11 '15 at 00:08
  • Simply don't use pixels. See http://developer.android.com/guide/practices/screens_support.html to understand how to support different screen sizes. – olegr Mar 11 '15 at 00:11