开发者

which touch event to use to slide an image?

开发者 https://www.devze.com 2022-12-30 07:36 出处:网络
i am using the following function to move a ball from one location to another wherever user touches the screen..right now i dont have an i-phone to test my application and i am new to i-phone applicat

i am using the following function to move a ball from one location to another wherever user touches the screen..right now i dont have an i-phone to test my application and i am new to i-phone application programming so i wanted to know does this event will also make the ball slide from one point to another wen user maintains the touch??

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

{

UITouch *touch=[[event allTouches] anyObject]; CGPoint location=[touch locationInView:to开发者_JAVA技巧uch.view]; fball.center=location; }


Implement -(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event and -(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event

0

精彩评论

暂无评论...
验证码 换一张
取 消