如何在图像上应用动画?
您好,我正在开发一个应用程序,其中我触摸屏幕的位置会显示图像,此时我正在以这种方式执行此操作。
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *move = [[event allTouches] anyObject];
CGPoint MovePoint = [move locationInView:self.view];
appDelegate.FinalMovePoint=MovePoint;
timer =[NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(Remaing) userInfo:nil repeats:YES];
[self showImageWithText:@"LongBlue" atPoint:appDelegate.FinalMovePoint];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.1];
imageView.alpha = 1.0;
[UIView commitAnimations];
}
在此显示我的图像,但是当调用 NSTimer
时,图像会闪烁或隐藏,我需要图像,直到触摸 -(void)touchesEnded:(NSSet *)touches withEvent:(调用 UIEvent *)event
方法。 请建议我如何完成这项工作。
Hi I am developing a application in which where I touch on screen an image is shown at that point I am doing this in this way.
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *move = [[event allTouches] anyObject];
CGPoint MovePoint = [move locationInView:self.view];
appDelegate.FinalMovePoint=MovePoint;
timer =[NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(Remaing) userInfo:nil repeats:YES];
[self showImageWithText:@"LongBlue" atPoint:appDelegate.FinalMovePoint];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.1];
imageView.alpha = 1.0;
[UIView commitAnimations];
}
In this my image is shown but when the NSTimer
is called image get blink or get hide I need the image until the touch the -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
method called.
Please suggest me how can I do this work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个。
Try this.