ugui production of simple horizontal progress bar

Renderings:

11171118-c50f5eb9d1018197.png
Renderings .png

analysis

The progress bar contains 3 parts: the white border, black background, the progress of the color yellow.
Corresponding UI elements, may be used to achieve image 3, as shown below:


11171118-dd3c005bc97c3f39.png
Structure FIG .png

Production process

1, white border
new image, the ProgressBar renamed, set the width and height, set to white color image, add slider assembly.
See the following figure:


11171118-ee4695c82471e069.png
White border .png

2, black background
analysis: black background with white border controls should be scalable size, it should control its properties by stretching the anchor.
New image, renaming of Bg, set to black image color, fill mode is provided:


11171118-d9bf91d7018ddf16.png
Set Fill mode .png

Setting the anchor, the central axes:
x, y ranging from 0 to 1, the ratio of the vertical level of identification, min, max x and y represent the top left bottom right anchor position.


11171118-d3577e52a0a77741.png
Anchor, the central axis .png

Set (white border size of numerical display means 2.5) xy offset based anchor:


11171118-9401c33991bf0a59.png
Xy offset based anchor .png

FIG always set as follows:


11171118-67787d46e5e67088.png
Black background .png

3, progress chart
analysis: progress chart with a white border controls should also be scalable size, it should control its properties by stretching the anchor.
New Image, renamed Progress, provided stretching, disposed offset anchor, setting color images, select images


11171118-6670d7785cadecf6.png
Progress chart .png

4, slider assembly disposed Fill Rect
will drag on progress FIG Progress Fill Rect properties can then progress through the slider of the control value (0 or 1)


11171118-eb390efe9ac14939.png
Set slider assembly .png

Thus, FIG schedule production is complete, slider assembly available in the code, by setting the progress value.

Reproduced in: https: //www.jianshu.com/p/8b85544a2d0c

Guess you like

Origin blog.csdn.net/weixin_33712881/article/details/91101451