Touch
来源:互联网 发布:薛之谦的淘宝店铺 编辑:程序博客网 时间:2024/05/16 16:22
///获取touch位置
CGPoint touchPoint=[touch locationInView:self.view];
NSString *str=[NSString stringWithFormat:@"%f",touchPoint.x];
myLabel.text =str;
// handle new touches
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
myLabel.text =@"touch";
[self processTouch:[touches anyObject]];
} // end method touchesBegan:withEvent:
-(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
//当触摸序列被诸如电话呼入这样的系统事件所取消时,发送touchesCancelled:withEvent:消息。
{
myLabel.text=@"cancelles";
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
myLabel.text=@"ended";
}
// exactly the same as touchesBegan:withEvent: minus double-tapping
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
myLabel.text=@"move";
[self processTouch:[touches anyObject]];
} // end method touchesMoved:withEvent:
CGPoint touchPoint=[touch locationInView:self.view];
NSString *str=[NSString stringWithFormat:@"%f",touchPoint.x];
myLabel.text =str;
// handle new touches
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
myLabel.text =@"touch";
[self processTouch:[touches anyObject]];
} // end method touchesBegan:withEvent:
-(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
//当触摸序列被诸如电话呼入这样的系统事件所取消时,发送touchesCancelled:withEvent:消息。
{
myLabel.text=@"cancelles";
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
myLabel.text=@"ended";
}
// exactly the same as touchesBegan:withEvent: minus double-tapping
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
myLabel.text=@"move";
[self processTouch:[touches anyObject]];
} // end method touchesMoved:withEvent:
- touch
- touch
- Touch
- TOUCH
- touch & >
- touch
- touch
- Touch
- touch
- touch
- touch
- touch
- touch
- Touch
- Touch
- touch
- touch
- touch
- iOS后台播放背景音乐文件
- iphone中获取文件路径的4种方法
- js实现方格游戏
- WebView
- Timer
- Touch
- Alert
- IPhone mapView
- X11,GTK,QT,GNOME,KDE的区别与联系(3)
- CDialog中使用工具栏和状态栏
- 如何判断Unity3D角色动作播放结束
- vi/vim中的查找与替换
- RichEdit 2.0响应回车换行
- QTabWidget