简体   繁体   English

更改快门动画iPhone的颜色

[英]change color of shutter animation iphone

I am making a photography based application i have used a shutter animation for progress. 我正在制作一个基于摄影的应用程序,我已经使用快门动画来取得进步。

here is my code.. 这是我的代码。

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

and my output is like this. 和我的输出是这样的。

在此处输入图片说明

but i want to change this black color of shutter.Please share your knowledge and help me. 但我想更改这种黑色的百叶窗。请分享您的知识并帮助我。

Unless the camera iris exposes a " color " property, I'm pretty certain you won't be able to change the color of the iris blades to anything arbitrarily. 除非相机的光圈暴露出“ color ”属性,否则我敢肯定,您将无法将光圈叶片的颜色任意更改。 That artwork is built into the OS and is static. 该插图已内置到操作系统中,并且是静态的。

If you are set on changing the color of the iris blades, you may need to do your own animation with your own graphics ( which other people have had to do, too ). 如果您准备更改虹膜叶片的颜色,则可能需要使用自己的图形制作自己的动画( 其他人也必须这样做 )。

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

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