【问题标题】:which touch event to use to slide an image?使用哪个触摸事件来滑动图像?
【发布时间】:2011-02-20 09:37:09
【问题描述】:

我正在使用以下功能将球从一个位置移动到另一个用户触摸屏幕的位置..现在我没有 iPhone 来测试我的应用程序,我是 iPhone 应用程序编程的新手,所以我想知道这个事件是否也会让球从一个点滑到另一个 wen 用户保持触摸??

-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

{

UITouch *touch=[[event allTouches] anyObject]; CGPoint location=[touch locationInView:touch.view]; fball.center=位置; }

【问题讨论】:

    标签: iphone ios-simulator


    【解决方案1】:

    实现-(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event-(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多