How to remove that black navigation bar on uiimage pickercontroller - ios

How to remove that black navigation bar on UIimage picker
we use video mode
already write code for hides the navigation bar and camera controls and toolbar
that is
picker = [[UIImagePickerController alloc] init];
picker.sourceType = sourceType;
picker.delegate = self;
picker.allowsEditing = NO;
picker.showsCameraControls = NO;

picker.cameraViewTransform = CGAffineTransformScale(imagePickerController.cameraViewTransform, 1, 1.32 );
Try this u can sole the issue
picker = [[UIImagePickerController alloc] init];
picker.sourceType = sourceType;
picker.delegate = self;
picker.allowsEditing = NO;
picker.showsCameraControls = NO;

as possible you can add this code:
picker.wantsFullScreenLayout = YES;

Related

How hide bottom toolbar

I have a problem showing the album a toolbar with the following buttons, previous and the new one appears in the bottom view. How can you hide this toolbar?
Thanks in advance.
Album photo image
UIImagePickerController *controller = [[UIImagePickerController alloc] init];
controller.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
controller.allowsEditing = YES;
controller.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType: UIImagePickerControllerSourceTypePhotoLibrary];
controller.delegate = self;
[self.navigationController presentViewController: controller animated: YES completion: nil];
If you want to hide the toolbar you can use the following code . Here the toolBarName is the name of your toolbar.
toolBarName.hidden=YES;
Include this in the viewWillAppear function:
self.navigationController?.isToolbarHidden = true
However, this is a Swift solution.
Use this code.Hope it helps..
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init] ;
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary])
{
imagePickerController.delegate = self;
imagePickerController.allowsEditing = FALSE;
[imagePickerController setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
[self presentViewController:imagePickerController animated:YES completion:nil];
}

UIPickerController Image Offset with an ImageView overlay subview

I am trying to overlay crosshairs in the camera, but after taking a picture, the image is offset from where it was taken. For example, I will line up the crosshairs with a lightbulb in my house, take the picture, and then the crosshairs will be around 20 pixels higher than the image. Here is my code for presenting the PickerController.
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
UIImageView *overlay = [[UIImageView alloc] initWithImage:[UIImage imageNamed:#"crosshairs_img"]];
overlay.center = CGPointMake((self.view.bounds.size.width/2), overlay.center.y+195);
overlay.alpha = .6;
overlay.contentMode = UIViewContentModeCenter;
overlay.clipsToBounds = YES;
[picker.view addSubview:overlay];
[self presentViewController:picker animated:YES completion:nil];

Black view at bottom when using custom camera overlay view (UIImagePickerController)

I want to use custom camera overlay view. Below is the code for it.
imagePicker = [[UIImagePickerController alloc] init];
self.imagePicker.delegate = self;
self.imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.imagePicker.showsCameraControls = NO;
self.imagePicker.cameraDevice = UIImagePickerControllerCameraDeviceFront;
self.imagePicker.toolbarHidden = YES;
self.imagePicker.wantsFullScreenLayout = YES;
self.imagePicker.navigationBarHidden = YES;
self.imagePicker.cameraOverlayView = [self cameraOverlayView];
The issue is there is a black background at bottom and I don't get from where it is coming.
What is wrong in code?
Try cameraViewTransform for full screen.
CGFloat camScaleup = 2;
imagePicker.cameraViewTransform = CGAffineTransformScale(imagePicker.cameraViewTransform, camScaleup, camScaleup);

How to add the UIImagePickerController in the custom view?

How to add the UIImagePickerController in the view ? If I add the image picker to the view, its show on the full screen. I need to show the on the centre of the view, But UIImagePickerController hide the navigation bar.
How add the UIImagePickerController in the view and also show the navigation bar ?
I am using the following code, I got the output like this(screenshot).
imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
imagePicker.cameraDevice = UIImagePickerControllerCameraDeviceRear;
imagePicker.showsCameraControls = NO;
imagePicker.navigationBarHidden = NO;
imagePicker.toolbarHidden = YES;
imagePicker.wantsFullScreenLayout = NO;
imagePicker.delegate = self;
imagePicker.cameraOverlayView = cameraOverlayView;
[self presentViewController:imagePicker animated:NO completion:nil];
I need some for show the navigation bar while add the UIImagePickerController in the view. Thanks in advance.
If you are develop application for iPad then you can use popoverviewcontroller to show imagepickerviewcontroller with navigation bar
please see thie link :
How to use UIImagePickerController in iPad?
Correct way to customize media capture here using Assets Library.
Simple way (in some cases) is using overlay view with frame size of whole screen and add controls on that view which simulate navigation bar.
if (_pickerOverlay == nil) {
_pickerOverlay = [[UIView alloc] initWithFrame:self.view.bounds];
//red transparent tint for demo
_pickerOverlay.backgroundColor = [UIColor colorWithRed:1.0
green:0.0
blue:0.0 alpha:0.6];
UIButton *btnBack = [UIButton buttonWithType:UIButtonTypeSystem];
btnBack.frame = CGRectMake(20, 20, 250, 40);
[btnBack setTitle:#"Custom buttom" forState:UIControlStateNormal];
btnBack.backgroundColor = [UIColor whiteColor];
[_pickerOverlay addSubview:btnBack];
}
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.showsCameraControls = NO;
picker.cameraOverlayView = _pickerOverlay;
[self presentViewController:picker animated:YES completion:nil];

unable to resize UIImagePickerController more than a certain height

I am trying to incorporate UIImagePickerController into my app by adding it through subview. But somehow I am unable to increase its height beyond a certain fixed size(the size in default camera app). Is there a way to increase the height? Like the "Fast camera" app does it.
Here is my code:
self.picker = [[UIImagePickerController alloc] init];
self.picker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
self.picker.cameraDevice = UIImagePickerControllerCameraDeviceRear;
self.picker.showsCameraControls = NO;
self.picker.navigationBarHidden = YES;
self.picker.toolbarHidden = YES;
self.picker.delegate = self;
[self.picker.view setFrame:CGRectMake(0, 65, 320, 444)];
[self.view addSubview:self.picker.view];
use cameraOverlayView property UIImagePickerController class for custom view
i don't know it exactly you want like.
try this one:
self.picker = [[UIImagePickerController alloc] init];
self.picker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
self.picker.showsCameraControls = YES;
self.picker.delegate = self;
[self.picker.view setFrame:CGRectMake(0,0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)];
[self.navigationController.view addSubview:self.picker.view];
i checked it working good in my app.
Happy Coding...

Resources