I want to create xml drawable to this shape,
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
use this layout and save in drawable folder.....
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<size
android:width="200dp"
android:height="50dp" />
<solid android:color="#ef45d1" />
<corners android:topRightRadius="20dp" />
</shape>
</item>
<item
android:bottom="0dp"
android:right="165dp"
android:top="0dp">
<rotate
android:fromDegrees="45"
android:pivotX="0%"
android:pivotY="0%"
android:toDegrees="45">
<shape android:shape="rectangle">
<solid android:color="#ffffff" />
</shape>
</rotate>
</item>
</layer-list>
and set in your layout view as background....
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:background="@drawable/newrecatngle"/>
NOTE:-set width and height as wrap_content.....
enjoy coding...........