How to put a TextView inside an ImageView?

Hello little androids! I am back here again to explain you something that took me some time until I came up with the solution.

I wanted something like this… a TextView (the score) inside an ImageButton:

Captura de pantalla 2013-08-20 a la(s) 14.06.24

In order to put a TextView or whatever inside another layout component, you just have to think it in another way, which is overlapping.

How to overlap?
You just have to AlignRight and AlignTop the TextView with the ImageView in the xml file.



    <!--... all the other attributes... -->




    <!--... all the other attributes... -->     




I hope it was helpful šŸ™‚
See you soon!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s