Hi, my problem is that if I start the UIImagePickerController with a custom overlay view, the camera is not covering the whole screen?
See on your self:
You see the black gap between the camera preview and the toolbar? I don't know how to fix that.
Thats the code:
Code:
self.camPicker = [[UIImagePickerController alloc] init];
self.camPicker.delegate = self;
self.camPicker.allowsEditing = NO;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
UIButton *takeButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height-40)];
[takeButton addTarget:self action:@selector(takeCamPic:) forControlEvents:UIControlEventTouchUpInside];
[self.camOverlay addSubview:takeButton];
self.camPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.camPicker.showsCameraControls = NO;
self.camPicker.cameraOverlayView = camOverlay;
self.camPicker.toolbarHidden = YES;
self.camPicker.navigationBarHidden = YES;
self.camPicker.wantsFullScreenLayout = YES;
} else
self.camPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:self.camPicker animated:YES];
The overlay view has the size 320*480 in the interface builder.
Did someone face the same problem?