-2

I want to get a drawable shape with two sided cutted corner. like this:enter image description here

I am not able to cut the edges. anyone help.

AkashToSky
  • 107
  • 1
  • 11

1 Answers1

1

Create a shape xml file in your drawable folder and then use this shape as background for a button or textview.

right_arrow_shape.xml:

Try this :-

 <?xml version="1.0" encoding="UTF-8"?>

<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:width="50dp" android:height="10dp" android:right="6dp">
    <shape>
        <solid android:color="@android:color/holo_green_dark"/>
        <corners
            android:bottomLeftRadius="0dp"
            android:topLeftRadius="0dp"/>
    </shape>
</item>

<item android:width="7dp" android:height="7dp"
    android:left="50dp">
    <rotate android:fromDegrees="45"
        android:pivotX="0"
        android:pivotY="0">
        <shape>
            <solid android:color="@android:color/holo_green_dark"/>
        </shape>
    </rotate>

</item>

Set this value in your button:-

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/right_arrow_shape"/>
Rajshree Tiwari
  • 630
  • 1
  • 7
  • 27