How to setup this layout in android?
In Android I'm trying to get a layout looking like thi开发者_开发知识库s image using xml.
What I've been trying to do is to separate the view vertical into two parts. One for the blue part and one for the white. For the blue part I use a shape as background to get the gradient and for the white part just a white background. It works good for the "Title" and "Some text" part. But as the image view should overlay both layouts it isn't working.
I can't figure out how to setup the xml layout to get it working, any ideas?
I would do it like this:
<RelativeLayout>
<TextView
android:id="@+id/title"
android:layout_alignParentTop="true"
android:text="title"
/>
<TextView
android:layout_below="@id/title"
android:layout_alignParentBottom="true"
android:text="some text here"
/>
<ImageView
android:layout_alignParentLeft="true"
android:text="title"
/>
</RelativeLayout>
Of course, you'll need to set the layout width, height, ... on those elements.
I think that you'll find the answer here: set the absolute position of a view in Android
精彩评论