进度视图翻转和缩放

Progress View Flip and Scale

我正在尝试翻转 Xcode 中的 UIProgressView 180,同时我正在尝试缩放进度视图。在我添加翻转之前缩放效果很好,然后缩放不再起作用。有什么建议么?谢谢!

[self.secondsPorgressBarTicker setTransform:CGAffineTransformMakeScale(1.0, 10.0)];

[self.secondsPorgressBarTicker setTransform:CGAffineTransformMakeRotation(-M_PI)];

您正在设置转换,然后将其重置。如果要组合变换,需要使用不同的CG函数。请记住,顺序对转换很重要,因此请使用能解决您问题的任何一个:

CGAffineTransform transform = CGAffineTransformMakeRotation(-M_PI);
transform = CGAffineTransformScale(transform, 1.0, 10.0);
[self.secondsPorgressBarTicker setTransform:transform];

CGAffineTransform transform = CGAffineTransformMakeScale(1.0, 10.0);
transform = CGAffineTransformRotate(transform, -M_PI);
[self.secondsPorgressBarTicker setTransform:transform];

您正在进行新的转换。修改已有的:

[self.secondsPorgressBarTicker setTransform:CGAffineTransformMakeScale(1.0, 10.0)];
[self.secondsPorgressBarTicker setTransform:CGAffineTransformRotate(self.secondsPorgressBarTicker, -M_PI)