HHHH
HHHH

Reputation: 1197

Adding UIImagePickerController as a subview

I want to add a UIImagePickerController in a custom frame, so have been following a few posts around adding the UIImagePickerController view as a subview.

A couple of questions:

Many thanks in advance!

My Code:

self.imagePicker = [[UIImagePickerController alloc] init];
self.imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
self.imagePicker.delegate = self;

//This is a subview of self.view. 
[self.pickerControllerHolderView addSubview:self.imagePicker.view];

// This seems to adjust the size of the view, but squashes the view. 
// self.pickerControllerHolderView.transform = CGAffineTransformMakeScale(1, 0.5);

Upvotes: 0

Views: 352

Answers (1)

Dima
Dima

Reputation: 23634

The internals of this class are private and it is not meant to be added as a subview. It is a self contained view controller and navigation controller and will most likely not work how you expect it to. If you need custom UI for picking photos, you should access the ALAssetsLibrary and display the contents yourself.

Upvotes: 1

Related Questions