0

i want to create something like that:

removed image

i have tried using relative layout, when I align the image and the background view to the top

and applying margin to the bg view:

    <RelativeLayout
        android:id="@+id/fieldLinearLayout"
        android:layout_width="match_parent"
        android:layout_height="80dp" >

        <ImageView
            android:id="@+id/mood"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_above="@+id/fieldLinearLayout1"
            android:layout_alignParentTop="true"
            android:layout_marginTop="20dp"
            android:src="@drawable/signup_illu_verificationcode" />

        <LinearLayout
            android:id="@+id/fieldLinearLayout1"
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:layout_alignParentTop="true"
            android:layout_marginTop="25dp"
            android:background="#f9ffff"
            android:orientation="vertical" >

but it didn't work, the bg covers the image.

how can I fix that?

Elad Benda
  • 35,076
  • 87
  • 265
  • 471
  • This will solve your issue... [Make image appear half of the screen][1] [1]: http://stackoverflow.com/questions/14544327/make-image-appear-half-of-the-screen%5D%5B1%5D – saopayne Dec 30 '13 at 20:55

2 Answers2

0

You can try using negative margins to move the ImageView up.

Michael Evans
  • 495
  • 3
  • 6
0

Have you tried using a FrameLayout? With a FrameLayout, you can decide the z-index by the order of which you add the items. The first items will sit on the bottom and the last items will sit on the top.

Jon Douglas
  • 13,006
  • 4
  • 38
  • 51
  • shouldn't "layout_above" and "layout_below" as i did be enough? – Elad Benda Dec 31 '13 at 07:48
  • In your question you state "The background covers the image". You can see some examples of above/below here: http://knowledge.lapasa.net/?p=334 in your case you wanted to "Layer". – Jon Douglas Dec 31 '13 at 15:58