I have the following layout:

```
<LinearLayout width:fill height:fill >
  <RelativeLayout width:fill height:wrap >
    <ImageView width:fill height:wrap >
    <LinearLayout width:wrap height:wrap />
  </RelativeLayout>
</LinearLayout>

```

The innermost LinearLayout seems to have no idea that it is inside the RelativeLayout when it comes to vertical properties. Gravity works only horizontally. For all intents and purposes (vertically), the inner LinearLayout thinks that the outer LinearLayout is its parent. Aligning parent Top/Bottom stretches it and the RelativeLayout to fill the outer LinearLayout. 

Ultimately what I want here is for the relative layout height to wrap the imageview almost as if it was its background (though it's meant to be an overlay on top of another view on top of the background), and the linear layout to simply work inside the constraints of the relative layout.

Furthermore, I want to be able to clip anything that goes outside the bounds of the relative layout wrapping the imageview. What's my best option here?