Reputation: 387
I am trying achieve the above design but using Frame Layout the blue image is not showing above the white background. Where is the mistake, please help?
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/adapter_flParent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@drawable/bg_edit_text"
android:elevation="5dp"
android:translationZ="1dp"
android:layout_margin="10dp"
android:padding="10dp">
<TextView
android:id="@+id/adapter_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="10dp"
android:text="Regional Snooker" />
<TextView
android:id="@+id/adapter_org"
android:layout_below="@+id/adapter_Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="10dp"
android:text="Concered Authority"/>
</RelativeLayout>
<ImageView
android:layout_width="100dp"
android:layout_height="60dp"
android:layout_margin="10dp"
android:layout_gravity="right"
android:background="@drawable/adapter_blue" />
<TextView
android:id="@+id/adapter_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="10dp"
android:gravity="right|center"
android:layout_gravity="right|center"
android:text="PASSED"/>
</FrameLayout>
I am trying to get the blue image but unable to get this blue image above white background using framelayout and also have to add the love image above blue image.
Upvotes: 0
Views: 470
Reputation: 131
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/adapter_flParent"
android:elevation="@dimen/ten_dp"
android:orientation="vertical"
android:layout_margin="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@drawable/white_corner_radius_background"
android:elevation="5dp"
android:weightSum="1"
android:orientation="horizontal"
android:layout_marginBottom="20dp">
<LinearLayout
android:layout_weight="0.75"
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_vertical">
<TextView
android:id="@+id/adapter_Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="@dimen/ten_dp"
android:paddingEnd="@dimen/ten_dp"
android:text="Regional Snooker"
/>
<TextView
android:id="@+id/adapter_org"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="@dimen/ten_dp"
android:paddingEnd="@dimen/ten_dp"
android:text="Concered Authority"/>
</LinearLayout>
<TextView
android:id="@+id/adapter_data"
android:layout_weight="0.25"
android:layout_width="0dp"
android:layout_height="match_parent"
android:gravity="center"
android:textColor="@color/white"
android:background="@drawable/test_blue_bg"
android:layout_gravity="right|center"
android:text="PASSED"/>
</LinearLayout>
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="@dimen/ten_dp"
android:layout_gravity="end|bottom"
android:elevation="10dp"
android:background="@drawable/ic_round_favorite_unfilled" />
</FrameLayout>
Upvotes: 2