ios 中的自定义进度条
Custom progress bar in ios
我正在尝试制作这个自定义栏,其中标签和进度条会根据彼此的宽度进行调整。是否有开源代码。
现在我只是在使用一个内置的进度条,但我不知道如何调整进度条和相对于进度条长度的文本。
cell.candidatesPollProgress.backgroundColor = [UIColor blueColor];
cell.candidatesPollProgress.progressTintColor = [UIColor blueColor];
cell.candidatesPollProgress.trackTintColor = [UIColor blueColor];
我该从哪里开始?感谢任何帮助。
为了使 UI 像共享的屏幕截图一样,您需要使用具有背景颜色的 UIView 而不是 UIprogressview。将 UILabel(百分比文本)的前导 space 约束设置为 UIView(进度视图)的尾端。将 UI 视图的宽度调整为 (progressValue)/(maxValue) * (max Width of Progress View)
我正在尝试制作这个自定义栏,其中标签和进度条会根据彼此的宽度进行调整。是否有开源代码。
现在我只是在使用一个内置的进度条,但我不知道如何调整进度条和相对于进度条长度的文本。
cell.candidatesPollProgress.backgroundColor = [UIColor blueColor];
cell.candidatesPollProgress.progressTintColor = [UIColor blueColor];
cell.candidatesPollProgress.trackTintColor = [UIColor blueColor];
我该从哪里开始?感谢任何帮助。
为了使 UI 像共享的屏幕截图一样,您需要使用具有背景颜色的 UIView 而不是 UIprogressview。将 UILabel(百分比文本)的前导 space 约束设置为 UIView(进度视图)的尾端。将 UI 视图的宽度调整为 (progressValue)/(maxValue) * (max Width of Progress View)