首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

多点抚摸的简单示例

2012-07-28 
多点触摸的简单示例- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{touchLabel.text

多点触摸的简单示例

- (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都勾上。

热点排行