tags:

views:

73

answers:

1

I need to draw a child view containing a rectangle and button on top of the content view at particular location on the parent (content view).
How can I do this? Did not find an explicit way to set origin of child view?

Thanks.

A: 

It depends. If you are talking about placing the rectangle at an absolute position, remember that android devices come with many many screensizes.

Hans
Yes, i can calculate the absolute coordinate of the rectangle. Or I can also calculate as a relative to the parent view.
Perhaps you can use a relative view, then set the margin around the rectangle to the offset you want. More info on relative views is here: http://developer.android.com/intl/fr/resources/tutorials/views/hello-relativelayout.html
Hans