this is my code:
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.showsCameraControls = NO;
picker.allowsEditing = NO;
picker.delegate = self;
picker.navigationBarHidden = YES;
picker.toolbarHidden = YES;
picker.wantsFullScreenLayout = YES;
UIView *overlay = [[UIView alloc] initWithFrame:CGRectZero];
overlay.backgroundColor = [UIColor greenColor];
overlay.alpha = 0.3;
overlay.clipsToBounds = NO;
UIButton *takePictureButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 1024, 1024)];
[takePictureButton addTarget:self action:@selector(takePictureButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
takePictureButton.backgroundColor = [UIColor purpleColor];
[overlay addSubview:takePictureButton];
picker.cameraOverlayView = overlay;
[takePictureButton release];
[overlay release];
_currentPicker = picker;
[self presentModalViewController:picker animated:YES];
[picker release];
And it’s look like on iPad 2 with iOS 4.3.2:
sorry, I can’t post image
What I want is it can take picture when user tap anywhere on the screen.
Forgive my poor English.
I solved this question by myself:
just reset the size of cameraOverlayView after present UIImagePickerController.
code like this:
Although it’s not elegant, but it work 🙂