进度视图翻转和缩放

时间:2015-01-29 15:30:55

标签: ios objective-c rotation scale progress

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

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

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

2 个答案:

答案 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)