在触摸时旋转视图

我必须在手指触摸上循环旋转视图...我的意思是像拨打旧手机号码......触摸应该只在角落.....任何人都可以帮助我...我试过它很多......但没有成功     
已邀请:
您需要在要旋转的视图上定义
UIRotationGestureRecognize
,然后添加选择器方法并像这样实现它。 添加这个给你
viewDidLoad
方法
UIRotationGestureRecognizer *rotate = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(rotation:)];

[myUIViewObject addGestureRecognizer:rotate];

[rotate release];
然后实现该方法。
- (void) rotation:(UIRotationGestureRecognize *) sender
{
    CGAffineTransform myTransform = CGAffineTransformMakeRotation(sender.rotation);
    sender.view.transform = myTransform;
}
PS。
myUIViewObject
可以是您要旋转的任何
UIView
对象。 编辑: 你会在这里找到很多相关信息: http://www.iphonedevsdk.com/forum/iphone-sdk-development/49847-how-find-angle-two-points.html     

要回复问题请先登录注册