lundi 25 mai 2015

Overlapping circleView on top of two different Layouts

I am trying to obtain this:

enter image description here

but I was only able to obtaing this:

enter image description here

using this layout:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://ift.tt/nIICcg"
    android:layout_width="match_parent" android:layout_height="match_parent"
    android:orientation="vertical" >
    <!--android:background="@mipmap/background_poly"-->
    <RelativeLayout android:id="@+id/headerL"
        android:layout_width="match_parent" android:layout_height="100dp"
        android:background="@color/account_grey_200">

</RelativeLayout>

<RelativeLayout android:id="@+id/account_det"
    android:layout_width="match_parent" android:layout_height="wrap_content">
    <de.hdodenhof.circleimageview.CircleImageView
        android:id="@+id/usrAvatar"
        android:layout_width="90dp" android:layout_height="90dp"
        android:src="@mipmap/aka"
        android:layout_marginLeft="10dp"
        android:layout_marginStart="10dp"
        android:layout_marginTop="38dp"/>

    <TextView android:id="@+id/usrName"
        android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:layout_marginLeft="8dp" android:layout_marginStart="8dp"
        android:layout_marginTop="2dp"
        android:text="CrisRe"
        android:textColor="#000000" android:textSize="14sp" android:textStyle="normal"
        android:layout_toEndOf="@id/usrAvatar"
        android:layout_toRightOf="@id/usrAvatar"
        android:layout_alignTop="@id/usrAvatar" />
    <!--android:layout_alignBaseline="@id/usrAvatar"-->

    <TextView android:id="@+id/usrEmail"
        android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:layout_marginTop="6dp"
        android:textColor="#000000"
        android:textSize="16sp"
        android:textStyle="normal"
        android:text="crisRe@mymail.com"
        android:layout_alignLeft="@id/usrName"
        android:layout_alignStart="@id/usrName"
        android:layout_below="@id/usrName" />
</RelativeLayout>

<LinearLayout android:layout_width="match_parent" android:layout_height="fill_parent"
    android:layout_below="@+id/headerL"
    android:background="@color/account_grey_400"/>

what's the matter? How can I overlap my CircleView on top of the two layouts? I've also considered using a drawable layer-list but I wasn't able to make it work. This one seemed to be the easiest solution, though I am also considering other alternatives.

Aucun commentaire:

Enregistrer un commentaire