tags:

views:

340

answers:

1

Hi,

I am using TabBarController in my application. In one of the view of the tabbar I am using a UIImagePickerController to pick an image.

When I add the picker as follows

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];

imagePicker.delegate = self;

imagePicker.editing = YES;

 [self presentModalViewController:imagePicker animated:YES];
 [imagePicker release];

It adds the picker, But at the time of choosing the photo, The bottom bar having the buttons "choose" and "cancel" gets hide under my tabbar. How to resolve this .

A: 

I haven't seen this problem - I have an app that uses a UITabBar and a UIImagePickerController together, and the tab bar does not obscure the image picker.

Inside my view controller, which is one of the UITabBar's view controllers, I'm creating the image picker as such:

self.imagePicker = [[[UIImagePickerController alloc] init] autorelease];
imagePicker.allowsImageEditing = NO;
imagePicker.delegate = self;
[self presentModalViewController:imagePicker animated:YES];

Seems very similar to your code, except that I'm setting the image picker as a retained property. Is your tab bar set up correctly? Is the view controller contained within the myTabBar.viewControllers array?

pix0r
Yes It is. I have a tabbar whose first controller is say firstViewCtonroller which has a navigationController. Using this navigationController I switch to different views and in one of the view I am using the above code. But the tabBar is not getting hidden under the imagePicker`s view.
rkb
Hey are you also facing any memory leak when you use the UIImageController.
rkb
Hey You might not be allowing the user to edit the Image. When You allow, the next view comes along with the tabBar at the bottom.
rkb
Good point, I'm not doing that. I will try it out and see if the tab bar shows up.
pix0r