Issue
I'm looking for a simple solution to to draw a rectangle with one edge that is curved. I'm trying to avoid creating a custom rectangle class and manually drawing it as I believe there's a much simpler solution that I have not considered. I have attached an image of the design I wish to create. Thank you in advance
edit:
I was thinking it maybe easier to round the white rectangle but I'm open to rounding the purple one.
Solution
You can try and play with oval shape and insets. Example:
<_inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetBottom="-20dp"
android:insetLeft="-20dp"
android:insetRight="-20dp">
<shape android:shape="oval">
<solid android:color="#FF0000"/>
</shape>
</inset>
I got a result similar to what you need with this
Answered By - Alex Orlov
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.