【问题标题】:animation in characters in iphoneiphone中的人物动画
【发布时间】:2009-09-16 21:59:02
【问题描述】:
让我们了解我的要求/问题。
- 我必须在我的应用程序中开发以下内容。
- 应用程序从视图控制器开始(显然)
- 现在,在加载视图控制器之后
- “Touch me”字符应输入屏幕动画,动画方向应随机。
好的。让我再澄清一下。
问题的目的是动画和触摸。
-
T(触摸我的一部分)应该从屏幕的任何角落进入,然后 o 和十个 u ...
在中心屏幕上所有字符调整后,必须处理触摸-点击事件。
如何做到这一点?
【问题讨论】:
标签:
iphone
objective-c
xcode
【解决方案1】:
小心。我已经实现了以下视图确实加载。
lblTT.hidden=YES; lbloo.hidden=YES; lbluu.hidden=YES; lblcc.hidden=YES; lblhh.hidden=YES;
lblT.hidden=YES; lblo.hidden=YES; lblu.hidden=YES; lblc.hidden=YES; lblh.hidden=YES;
animation = [CABasicAnimation animationWithKeyPath:@"position"];
[animation setDelegate:self];
animation.toValue = [NSValue valueWithCGPoint:CGPointMake(lblTT.frame.origin.x+17,lblTT.frame.origin.y+29)];
animation.fromValue = [NSValue valueWithCGPoint:CGPointMake(lblT.frame.origin.x,lblT.frame.origin.y)];
animation.autoreverses = NO;
animation.removedOnCompletion=YES;
animation.repeatCount = 0;
animation.duration = 1;
animation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear];
lblT.hidden=NO;
[lblT.layer addAnimation:animation forKey:@"T"];
[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(hideT) userInfo:nil repeats:NO];