1

I have a relative layout with background image. On that image I have a text called 'GOT IT'. Is it possible to put a button exactly over that text of background?

If I am putting a static position of button it is varying in different screen size. Is there any solution for my problem?

user1619306
  • 169
  • 1
  • 5
  • 12

1 Answers1

0

You can use background without Text and put a TextView instead. This will be the simpliest solution.

Another approach is to create picture that has the same size as your background. This picture should have transparent background and in the place of text there should be some color rectangle. In the application you are using two backgrounds - one normal with 'GOT IT' text and the prepared one -> but hidden behind the normal background. In the code you can easily position your rectangle and set your button size according to it.

Gaskoin
  • 2,469
  • 13
  • 22
  • The button which i want to place over GOT IT text should be clickable. If a use a another transparent background how could i make that button clickable? – user1619306 Jul 15 '14 at 14:08
  • lol this background will be UNDER EVERYTHING so it will be not focusable and clickable... Just check it instead of creating artificial problems – Gaskoin Jul 15 '14 at 14:21