Reputation: 1814
I am attempting to draw the medal overlaying the corner of the score screen shown here
There is an transparent layout holding the buttons and a RelativeLayout (black edge box), which holds the interior box (grey box) that contains the rest of the data. I tried adding the medal to the top left corner of the interior RelativeLayout and giving it negative margins, but that just cuts it off at the edge of the view. Adding it to the transparent layout puts it behind the corner.
How can I force the medal to overlay that corner? I'd prefer to do it in xml if possible, but any suggestions are welcome.
Upvotes: 4
Views: 2873
Reputation: 14494
You can also achieve this by setting the android:clipChildren="false"
and android:clipToPadding="false"
attributes on the parent view (and if that doesn't work, set it on all the ancestor view groups as well, eventually it will work).
Upvotes: 4
Reputation: 5960
In the xml layout, an element that define after will overlay the element that define before. So, you could change layout to something like this:
<LinearLayout>
<LinearLayout> <!--grey box --> </LinearLayout>
<ImageView src="medal" android:layout_marginLeft="-250dip"/>
<!-- change the amount of marginLeft to your desire -->
</LinearLayout>
Upvotes: 2
Reputation: 1565
merge them ...
http://developer.android.com/resources/articles/layout-tricks-merge.html would help
Upvotes: 0