Search code examples
androidandroid-layoutandroid-relativelayout

Proportionnal RelativeLayout


I want to achieve the following:

  • a picture, as a background, which resize according to the screen size
  • I want to put button on top of this picture, while maintaining a proportional position to the picture width and height.

See the example:

enter image description here

The background is an image with the fill_parent settings for width/height.The yellow squares are buttons on top of this picture.

So, how can I keep the button on the exact same position on top of the picture with different screen size, using relative layout (or others layout)


Solution

  • The solution was to use the "Percent Support Library" as stated by @subhash