2011-11-02 5 views
3

をquartzcore使用UITextviewのテキストを点滅する私は、そのアプリケーションのクライアントに対して1つのアプリケーションを作成する4.2 developing.Inは、テキストのようないくつかの機能が点滅しなければならない必要。は、私はXcodeで、いくつかの疑問を持っているどのようなフレームワーク

  • このテキストをどのように点滅させるか。この問題にどのボディを解決する方法

    は、この問題についてそのアイデアを持っている任意の外部ライブラリを使用すると私の問題を解決するために役立つようにしてみてください。

事前にお世話になりました。

答えて

11

を私はCore Animationのを使用してこの問題を解決しました。せん断ため

CABasicAnimation *basic=[CABasicAnimation animationWithKeyPath:@"transform"]; 
[basic setToValue:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.25, 1.25, 1.25)]]; 
[basic setAutoreverses:YES]; 
[basic setRepeatCount:MAXFLOAT]; 
[basic setDuration:0.25]; 
[self.imgVArrow.layer addAnimation:basic forKey:@"transform"]; 
9

はこれを試してみてください:

- (void)blinkAnimation:(NSString *)animationID finished:(BOOL)finished target:(UIView *)target 
{ 
    NSString *selectedSpeed = [[NSUserDefaults standardUserDefaults] stringForKey:@"EffectSpeed"]; 
    float speedFloat = (1.00 - [selectedSpeed floatValue]); 

    [UIView beginAnimations:animationID context:target]; 
    [UIView setAnimationDuration:speedFloat]; 
    [UIView setAnimationDelegate:self]; 
    [UIView setAnimationDidStopSelector:@selector(blinkAnimation:finished:target:)]; 

    if([target alpha] == 1.0f) 
     [target setAlpha:0.0f]; 
    else 
     [target setAlpha:1.0f]; 
    [UIView commitAnimations]; 
} 

はUILabel上で私の関数を呼び出します。このような

[self blinkAnimation:@"blinkAnimation" finished:YES target:labelView]; 
+0

感謝。 –

関連する問題