Issue
I would want to use the same borders than this button: (cf.: https://graphicdesign.stackexchange.com/). Is it possible to use the radius
XML properties (borderLeftTopRadius
, etc.) to do it? Or must I use some image(s)?
Solution
Just create a Drawable resource file : custom_button.xml
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="153.77dp"
android:height="41.33dp"
android:viewportWidth="153.77"
android:viewportHeight="41.33">
<path
android:strokeColor="#e94b5a"
android:strokeWidth="1"
android:strokeMiterLimit="10"
android:pathData="M 9.89 0.5 L 144.22 0.5 L 153.22 20.5 L 144.22 40.83 L 10.22
40.83 L 0.55 20.5 L 9.89 0.5 Z" />
</vector>
then put it as background of your button :
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ask question"
android:textColor="#E94A5A"
android:background="@drawable/custom_button"/>
Screenshot :
Answered By - Hani Bouras
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.