我试图在Xcode中翻转UIProgressView 180,我正在尝试同时缩放进度视图。缩放效果很好,直到我添加翻转,然后缩放不再起作用。有什么建议?谢谢!
[self.secondsPorgressBarTicker setTransform:CGAffineTransformMakeScale(1.0, 10.0)];
[self.secondsPorgressBarTicker setTransform:CGAffineTransformMakeRotation(-M_PI)];
答案 0 :(得分:1)
您正在设置转换然后重置它。如果要组合变换,则需要使用不同的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];
答案 1 :(得分:0)
您正在进行新的转化。修改现有的:
[self.secondsPorgressBarTicker setTransform:CGAffineTransformMakeScale(1.0, 10.0)];
[self.secondsPorgressBarTicker setTransform:CGAffineTransformRotate(self.secondsPorgressBarTicker, -M_PI)