The invention discloses a reusable control
rounding setting method. The method includes the following steps that S1, a tool class of UIImage is created, a rectangular image of which a central hollow-out pattern is a
rounded rectangle is drawn through the UIImage, and cached in a
system folder; wherein a drawing method includes the steps that S11, a drawn context is acquired, a drawn parameter is set, the drawn parameter comprises a
line width and an inward reduction width; S12, an outer rectangle is drawn, and the size of the rectangular image is set; S13, a first
rounded rectangle of the inner layer is drawn, and the size,
rounding position and
radius size of a circular bead of the first
rounded rectangle are set; S4, the drawn context is ended to obtain the rectangular image of which thecentral hollow-out pattern is the rounded rectangle; S2, the rectangular image is called to overwrite the upper layer of a
target control that needs to be rounded. According to the reusable control
rounding setting method, by calling the pre-drawn and pre-cached rectangular image to carry out rounding
processing on the
target control, the problem of interface caton and off-screen rendering with alarge number of rounded corners in the prior art is solved.