Renderings:
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:
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:
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:
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.
Set (white border size of numerical display means 2.5) xy offset based anchor:
FIG always set as follows:
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
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)
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