【问题标题】:change color of shutter animation iphone更改快门动画iphone的颜色
【发布时间】:2013-03-30 10:10:33
【问题描述】:

我正在制作一个基于摄影的应用程序,我使用快门动画来取得进展。

这是我的代码..

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self performSelector:@selector(makeRound) withObject:nil afterDelay:2.0];
}
-(void)makeRound
{
    [[[self.view viewWithTag:90] layer] setMasksToBounds:YES];
    [[[self.view viewWithTag:90] layer] setCornerRadius:75.0];
    [[[self.view viewWithTag:90] layer] setBorderWidth:2.0];
    [[[self.view viewWithTag:90] layer] setBorderColor:[[UIColor blackColor] CGColor]];
    [(UILabel *)[[self.view viewWithTag:90] viewWithTag:991] setText:@"Loading.."];
    [self shutter];
}
-(void)shutter
{
    CATransition *shutterAnimation = [CATransition animation];
    [shutterAnimation setDelegate:self];
    [shutterAnimation setDuration:1.5];
    [shutterAnimation setType:@"cameraIris"];
    [shutterAnimation setValue:@"cameraIris" forKey:@"cameraIris"];
    [shutterAnimation setRepeatCount:1];
    [[[self.view viewWithTag:90] layer] addAnimation:shutterAnimation forKey:@"cameraIris"];
}
-(void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
{
    [self performSelector:@selector(shutter) withObject:nil afterDelay:0.5];
}

我的输出是这样的。

但我想改变这种黑色的快门。请分享你的知识并帮助我。

【问题讨论】:

    标签: iphone ios ipad caanimation


    【解决方案1】:

    除非相机光圈公开“color”属性,否则我很确定您将无法任意更改光圈叶片的颜色。该艺术品内置于操作系统中并且是静态的。

    如果您要更改虹膜叶片的颜色,您可能需要使用自己的图形制作自己的动画 (which other people have had to do, too)。

    【讨论】:

      猜你喜欢
      • 2013-09-10
      • 1970-01-01
      • 2011-05-06
      • 1970-01-01
      • 1970-01-01
      • 2020-04-12
      • 2019-08-31
      • 2017-09-04
      • 1970-01-01
      相关资源
      最近更新 更多