我正在开发一个需要在一端旋转滑块的应用程序。但是,通过使用CGAffineTransformMakeRotation(),我只能旋转中心的滑块。
我应该怎么做才能在终点旋转滑块?如果可能,请给出一小段示例代码。非常感谢。
发布于 2010-01-04 20:58:39
我通过设置视图的层的anchorPoint属性来旋转UIImageView。例如:
myView.layer.anchorPoint = CGPointMake(0.5, 1.0);然后应用CATransform3DRotate作为图层的transform属性
CATransform3D rotationTransform = CATransform3DIdentity;
rotationTransform = CATransform3DRotate(rotationTransform, positionInRadians, 0.0, 0.0, 1.0);
myView.layer.transform = rotationTransform;我在苹果的metronome示例中发现了这一点,所以值得一试。希望这能有所帮助
https://stackoverflow.com/questions/1999309
复制相似问题