Android custom view summary of basic functions you need to know

Android custom view basic functions you need to know

First, draw on the canvas. You need a paint. What are the functions commonly used by brushes. Because there is a debugging environment, the function is basically written silently. If there is an error, please comment and put it forward, crab!

When we have a brush, we can draw basic graphics.

Line:

Rectangle:

Rounded rectangle:

circular

Note that the second parameter here is calculated from 0 ° in the three o'clock direction, so if you want to draw from the middle of 12 o'clock, it is 270 °. The fourth parameter is to decide whether to pass through the center of the circle (you can know the difference by changing this parameter yourself).

The above functions are basically the most basic functions used to customize the view. Welcome to add them.

Thank you for reading, hope to help you, thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>