开发者

String to Appear Bit by Bit Logic

What I want to achieve is to have a name in the middle of the screen appear one letter at a time, at a timed interval.

I have the following for my "fade in" effect:

// Fade In effect
-(void)fadeIn:(UIView*)viewToFadeIn withDuration:(NSTimeInterval)duration 
  andWait:(NSTimeInterval)wait
{

[viewToFadeIn setAlpha:0.0];
[UIView animateWithDuration:duration delay:wait options:UIViewAnimationOptionTransitionCurlUp animations:^{[viewToFadeIn setAlpha:1.0];} completion:nil];

}

Is there any animation for 开发者_如何学Pythonthis??

Any help is appreciated, thank you!!!


Just use a NSTimer to cal a method to reset the field string each time using one more character of the string, for example;

NSUInteger  theLength = [outputString length]+1;
if( theLength == [originalString length]
{
    [timer invalidate];
    timer = nil;
    outputString = originalString;
}
else
    outputString = [originalString substringToIndex:theLength];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜