如何使用石英核框架实现UITextview文本的闪烁



我在xcode 4.2开发中有几个问题。在我创建一个应用程序的应用程序客户端需要一些功能,如文本应该被眨眼。

  • 在quartzcore框架中如何闪烁文本。

    如何解决这个问题,任何人有关于这个问题的想法,试图帮助解决我的问题,使用任何外部库

提前谢谢你的帮助

我用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"];

试试这个:

- (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];

像这样:https://github.com/nicklockwood/FXLabel

最新更新