UIRotationGesture 之后重置视图
我在 UIImageView 上有一个 UIRotationRecognizer。旋转视图后,我想提交更改,以便下次旋转图像时它会自然旋转。目前,使用下面的代码,释放触摸并尝试再次旋转后,原点似乎已关闭。
[Export("RotationSelector")]
private void RotationSelector(UIRotationGestureRecognizer recognizer)
{
recognizer.View.Transform = CGAffineTransform.MakeRotation(recognizer.Rotation);
if (recognizer.State == UIGestureRecognizerState.Ended)
// Reset origin here...
}
谢谢
I have a UIRotationRecognizer on an UIImageView. After I rotate the view I would like to commit the changes so that next time I rotate the image it rotates naturally. Currently, with the code below, it looks like the origin is off after release the touch and try to rotate again.
[Export("RotationSelector")]
private void RotationSelector(UIRotationGestureRecognizer recognizer)
{
recognizer.View.Transform = CGAffineTransform.MakeRotation(recognizer.Rotation);
if (recognizer.State == UIGestureRecognizerState.Ended)
// Reset origin here...
}
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要像这样重置您的转换:
You need to reset your transformation like this: