-(voID)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UItouch *touch = [[event alltouches] anyObject]; CGPoint location = [touch locationInVIEw: touch.vIEw]; imageVIEw.center = location;}-(voID)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { [self touchesBegan:touches withEvent:event];}解决方法 好的,找到了解决方案,这里是代码:
-(voID)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UItouch *touch = [[event alltouches] anyObject]; if ([touch vIEw] == imageVIEw) { CGPoint location = [touch locationInVIEw: self.vIEw]; imageVIEw.center = location; }}总结
以上是内存溢出为你收集整理的xcode – [IOS SDK] – touchesBegan与特定对象?全部内容,希望文章能够帮你解决xcode – [IOS SDK] – touchesBegan与特定对象?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)