繁体   English   中英

更改快门动画iPhone的颜色

[英]change color of shutter animation iphone

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

这是我的代码。

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

和我的输出是这样的。

在此处输入图片说明

但我想更改这种黑色的百叶窗。请分享您的知识并帮助我。

除非相机的光圈暴露出“ color ”属性,否则我敢肯定,您将无法将光圈叶片的颜色任意更改。 该插图已内置到操作系统中,并且是静态的。

如果您准备更改虹膜叶片的颜色,则可能需要使用自己的图形制作自己的动画( 其他人也必须这样做 )。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM