读书人

多点抚摸的简单示例

发布时间: 2012-07-28 12:25:13 作者: rapoo

多点触摸的简单示例

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{touchLabel.text = @"Touches Began";}- (void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event{touchLabel.text = @"Touches Cancelled";}- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{touchLabel.text = @"Touches Stopped";}- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{touchLabel.text = @"Drag detected";}

?

需要注意的是:在Interface Builder中,必须将view的属性Interaction里的两项User Interaction Enabled和Multiple Touch都勾上。

读书人网 >移动开发

热点推荐