I want to create a custom View similar to this image. More specifically, the dark “number of riders” view. I don’t want to use an image for background. I need a drawable xml for the background.
I want to create a custom view similar to this image. More specifically, the dark “Number of Riders” view. I don’t want to use the image as background. I need a drawable xml as background.
I am new to Android so any help would be appreciated.
I’m new to Android, so any help would be greatly appreciated.
1 solution
#1
0
The best way to do that will be to use a 9-patch drawable file and set it as the background of the TextView. Here is how you can do that: http://en.miui.com/thread-26099 -1-1.html
The best way is to use the 9-patch drawable file and set it as the background of the TextView. Here’s how to do it: http://en.miui.com/thread-26099-1-1.html
Or you can create an SVG and use that as background. The easiest way to do that would be to make a png image and convert it to SVG file using online converters. How to convert a PNG image to a SVG?
p>
Or you can create an SVG and use it as a background. The easiest way is to use an online converter to make a png image and convert it to an SVG file. How to convert PNG image to SVG?
There is more complicated way to archive it like drawing on a canvas and using that as background, But I would recommend you to use 9-patch file.
There are more sophisticated ways to archive it like drawing on a canvas and using it as a background, but I recommend you to use a 9-patch file.