I do not need you to worry about the text or gradient or shadow, I will work that out. I just don't know how to draw the outline in XML using layer-lists.
Asked
Active
Viewed 86 times
-1
-
1The edge of this view is not actually round for a paint Object.. So its better you should use a Image as Background.. Probably a 9-patch image – ADM Apr 18 '20 at 14:19
-
Does this answer your question? [CardView: How do I add a gradient background while maintaining the radius](https://stackoverflow.com/questions/55714392/cardview-how-do-i-add-a-gradient-background-while-maintaining-the-radius) – Taslim Oseni Apr 18 '20 at 14:44
1 Answers
0
If you want to draw a shape with rounded corners (and dont want to have this "cut shapy" shape) you just need to create drawable file using this code:
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/colorPrimary"/>
<corners android:radius="25dp"/>
</shape>
but, if you want to make exact shape like this image, i think that you should use image on the background of button.

Iona Bartishvili
- 97
- 2
- 10