Push UIImagePickerController to the left
I am making a camera app, which gives the user access to the Photo Library. They touch the button, and UIImagePickerControllerSourceTypeSavedPhotosAlbum pops up using presentModalViewController. When they touch a photo, I want a view to push the ImagePicker to the left and the new view to come in. The thing is, I want to keep the ImagePicker up, so when they go bac开发者_Go百科k to it there isn't a lag. This happens in many camera apps like NightCamera. Whenever I use [self.navigationController pushViewController:photoPreview];
, it pushes the view to the main view, not the picker. When I use [picker.navigationController pushViewController:photoPreview];
, nothing happens, because the picker's navigationController is nil. Does anyone know what to do?
Yes it is possible. There is no such thing as "modal view controller", any view controller can be presented modaly.
Since UIImagePickerController
is already a UINavigationController
, you can push views directly on it. So instead of
[picker.navigationController pushViewController:some_view_controller];
just do
[picker pushViewController:some_view_controller];
removing .navigationController
.
Try this:
if (!picker.navigationController)
UINavigationController *navC = [[[UINavigationController alloc] initWithRootViewController:picker] autorelease];
[picker pushViewController:photoPreview];
精彩评论