2013-03-30 80 views
1

我正在製作基於攝影的應用程序,我使用快門動畫來獲取進度。更改快門動畫的顏色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]; 
} 

和我的輸出是這樣的。

enter image description here

,但我想改變shutter.Please的這個黑色分享你的知識和幫助我。

回答

0

除非相機光圈暴露出「color」屬性,否則我相當肯定您將無法將虹膜刀片的顏色任意更改爲任意值。該作品內置於OS中並且是靜態的。

如果設置爲更改虹膜刀片的顏色,則可能需要使用自己的圖形(which other people have had to do, too)自己製作動畫。