UIImagePickerController in iOS7 - iphone

How to get UIImagePickerController in iOS 7 Look like the same screen that show in the attached screen shot with out using Overlay Controller.
This is the code am using for picker controller.
UIImagePickerController *eImagePickerController = [[UIImagePickerController alloc] init];
eImagePickerController.delegate=self;
eImagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
eImagePickerController.cameraDevice = UIImagePickerControllerSourceTypeCamera;
eImagePickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
eImagePickerController.showsCameraControls = YES;
eImagePickerController.navigationBarHidden = NO;
eImagePickerController.cameraDevice=UIImagePickerControllerCameraDeviceRear;
eImagePickerController.wantsFullScreenLayout = NO;
eImagePickerController.cameraViewTransform = CGAffineTransformScale(eImagePickerController.cameraViewTransform, CAMERA_TRANSFORM_X, CAMERA_TRANSFORM_Y);
[self presentViewController:eImagePickerController animated:YES completion:nil];
The issue is shown in attached screenshot

The following code will present the UIImagePickerController in a way that resembles the screenshot given.
UIImagePickerController *eImagePickerController = [[UIImagePickerController alloc] init];
eImagePickerController.delegate = self;
eImagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
eImagePickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
eImagePickerController.cameraDevice= UIImagePickerControllerCameraDeviceRear;
eImagePickerController.showsCameraControls = YES;
eImagePickerController.navigationBarHidden = NO;
[self presentViewController:eImagePickerController animated:YES completion:nil];
Just make sure that you hide the status bar or it will be displayed in the UIImagePickerController as well.

Related

UIImagePickerControllerSourceTypePhotoLibrary in iOS 7 is not Working

When I upgraded to iOS7, my app is showing an empty view controller when I access the photo Library from the application. It was working with older frameworks.
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePickerController.delegate = self;
self.imagePicker = imagePickerController;
//self.imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentViewController:self.imagePicker animated:YES completion:nil];
Please apply direct this code
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePickerController.delegate = self;
[self presentViewController:imagePickerController animated:YES completion:nil];
when this code run then "application" Would like to access your photos message come when you click on OK then all images will be displayed
Thanks.

Change default option of UIimagePickerController

after taking a picture it is displying Retake,Preview and Use button.I need to change Use button as Save button.Is it possible?.
UIImagePickerController * imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.delegate = self;
[self presentModalViewController:imagePicker animated:YES];

How to set Custom overlay view on Editing View of UIImagePickerController?

All
I have create UIImagePickerController with delegate and picking images from PhotoLibrary.
imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;
[self presentModalViewController:imagePicker animated:YES];
And when application reach to Editing view of UIImagePickerController i set one Overlay view and create two buttons for it.
Cancel and Choose
On Cancel Button click
[imagePicker popToViewController:[currentViewController.viewControllers objectAtIndex:1] animated:YES];
this cod work fine..
But choose Button does not working,
if i set code like here,
[self imagePickerController:imagePicker didFinishPickingMediaWithInfo:[imagePicker mediaTypes]];
than it returns NULL value of info dictionary.
Is that any other way to set overlay view on Editing ImagePicker ?
Regards,
try this code
CustomOverlayView *CustomOverlayView = [[CustomOverlayView alloc] initWithFrame:CGRectZero];
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePickerController.allowsEditing = NO;
imagePickerController.delegate = self;
imagePickerController.showsCameraControls = YES;
[imagePickerController.view addSubview:CustomOverlayView];
[self presentModalViewController:imagePickerController animated:YES];
}

Issue with imagePicker

I've got a little tiny problem when i present a ImagePickerController..
Here is my code:
UIImagePickerController *imgPicker = [[UIImagePickerController alloc] init];
imgPicker.allowsEditing = NO;
imgPicker.delegate = self;
imgPicker.navigationBarHidden = YES;
imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:imgPicker animated:YES];
And this is what i see on my device:
We can see something which can be a navigationBar but i set it to HIDDEN and nothing change..
Anyone has an idea?

ARToolkit, UIImagePickerController & cameraOverlayView: How to take a picture?

I am developing an Augmented Reality app for iPhone with ARToolkit. Now I want to include its functionality in a main app, with a button which throws an 'AR View', in order to be able to take a picture with the 3D model on it.
I am using UIImagePickerController with cameraOverlayView to add the ARViewController view to the camera view, as an overlay, but it does not show it. Here it is the code:
-(IBAction)Switch2AR:(id)sender{
ARController = [[ARViewController alloc] init];
[ARController loadView];
UIImagePickerController *picker = [[UIImagePickerController alloc]init];
picker.delegate = self;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
}
else {
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
}
picker.showsCameraControls = YES;
picker.cameraOverlayView = ARController.view;
//[ARController.view addSubview: picker.view];
//[picker.view addSubview: ARController.view];
//[picker viewWillAppear:YES];
//[picker viewDidAppear:YES];
//[ARController viewWillAppear:YES];
//[ARController viewDidAppear:YES];
[self presentModalViewController:picker animated:YES];
[ARController release];
}
I also tried to add the UIImagePickerController view as a subview of the ARViewController view, but does not work since the camera modal view 'hides' the AR view. Also ARViewController view as UIImagePickerController subview.
The problem is that I cannot overlay my ARView and the camera view in any way I tried
Thanks in advance
Just change
picker.showsCameraControls = YES;
to
picker.showsCameraControls = NO;
and it should work.