i have a design which demands a background like the image below for the number on the right hand side. Is there any we can achieve this in Android ?
Will i need to make a 9 patch image and set it as a background ?
i have a design which demands a background like the image below for the number on the right hand side. Is there any we can achieve this in Android ?
Will i need to make a 9 patch image and set it as a background ?
First, create a shape to have rounded corners.
Then apply this as the background to your Views:
You may need to do some tweaking. You may even be able to discard the
LinearLayout
and set theandroid:background
of theTextView
to@drawable/rounded_edges
I know this is an old question but for anyone who struggles with this, I strongly recommend ViewBadger library
First create a drawable resource.
Then reference this drawable in your layout:
One of the good Reference :
TextView with rounded corners
Thanks.