0

Hi friends please help here i trying to do below shape more than three days but cant able to get it how can i do it

enter image description here

But the Output i am getting is this one

enter image description here

Below is my code

close_drawable.xml

    <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="oval">
            <solid android:color="#30000000"/>
            <size android:height="70dp" android:width="70dp"/>
        </shape>
        <clip android:gravity="left" android:clipOrientation="horizontal"/>
    </item>
    <item android:drawable="@drawable/close" android:width="50dp" android:height="50dp" android:gravity="center"/>

</layer-list>

And my Xml Code is

    <RelativeLayout
        android:id="@+id/bottomroot"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="5dp"
        android:gravity="center"
        android:orientation="horizontal">

        <ImageView
            android:id="@+id/nope"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:srcCompat="@drawable/close_drawable" />


        <ImageView
            android:id="@+id/superlike"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
android:layout_marginLeft="-1.5dp"
            android:layout_toRightOf="@+id/nope"
            app:srcCompat="@drawable/superlike_drawable" />

        <ImageView
            android:id="@+id/like"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="-1.5dp"
            android:layout_toRightOf="@+id/superlike"
            app:srcCompat="@drawable/like_drawable" />

        <ImageView
            android:id="@+id/like_list"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="-1.5dp"
            android:layout_toRightOf="@+id/like"
            app:srcCompat="@drawable/likelist_drawable" />

        <TextView
            android:id="@+id/textView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignStart="@+id/superlike"
            android:layout_alignEnd="@+id/superlike"
            android:gravity="center"
            android:layout_below="@+id/superlike"
            android:text="Mashalla!"
            android:textColor="#fff" />
    </RelativeLayout>

enter image description here

prominere
  • 79
  • 2
  • 10

1 Answers1

0

Your circle xml shoul look like this:

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" >
<solid android:color="#20000000" />
<size
    android:width="70dp"
    android:height="70dp" />
</shape>

EDIT: this can happen if you have paddings in the layout that holds the ImageVIew

X3Btel
  • 1,408
  • 1
  • 13
  • 21