android - How to solve this not properly scaled background for custom shaped button? -
this got:
i want nice resizeable triangle custom shaped button, have triangle shape resizing, proportionally resize, got button triangle in left bottom side.
this code custom shaped xml backround button: https://looksok.wordpress.com/2013/08/24/android-triangle-arrow-defined-as-an-xml-shape/
edit2 : source code custom shape button.xml above link:
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <rotate android:fromdegrees="45" android:todegrees="45" android:pivotx="-40%" android:pivoty="87%" > <shape android:shape="rectangle" > <stroke android:color="@color/transparent" android:width="10dp"/> <solid android:color="@color/your_color_here" /> </shape> </rotate> </item> </layer-list>
edit : "@drawable/background_buttons"
== custom shaped xml
this code 2 button in layout:
<button android:id="@+id/button02" android:background="@drawable/background_buttons" android:layout_width="220dp" android:layout_height="120dp" /> <button android:id="@+id/button1" android:layout_width="220dp" android:layout_height="120dp" android:layout_alignparentbottom="true" android:layout_centerhorizontal="true" />
Comments
Post a Comment