Created
December 21, 2009 06:37
-
-
Save cqa02303/260816 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
UIImagePickerController *controller = [[[UIImagePickerController alloc] init] autorelease]; | |
controller.sourceType = UIImagePickerControllerSourceTypeCamera; | |
controller.cameraOverlayView = self.cameraOverlay; | |
[self performSelector:@selector(removeOverlayView:) withObject:controller afterDelay:0.1f]; | |
controller.allowsEditing = YES; | |
controller.delegate = self; | |
// ニュッと出るのでは無く、フェードする | |
controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; | |
[self presentModalViewController:controller animated:YES]; | |
} | |
// overlay viewを外すけどlayerツリーは残す | |
- (void) removeOverlayView:(UIImagePickerController*)controller { | |
// overlayの親子を把握する | |
CALayer *splayer = self.cameraOverlay.layer.superlayer; | |
controller.cameraOverlayView = nil; | |
[splayer addSublayer:self.cameraOverlay.layer]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment