1024programmer Java Rectangular box with one side diagonal -rectangularboxwithonesidediagonal

Rectangular box with one side diagonal -rectangularboxwithonesidediagonal

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.

Here is the required image

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.

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/759219

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索