Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6944545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:19:14+00:00 2026-05-27T13:19:14+00:00

I am showing a UIImagePicker (itself in a UIView) via a UIPopOver. This works

  • 0

I am showing a UIImagePicker (itself in a UIView) via a UIPopOver. This works fine, however when the iPad is rotated onto its right side I get a strange black bar along the left hand side of the popover as per the image below. The cancel button is also partially off the right hand of the screen. This doesn’t happen in any other orientation which is odd.

The code is also listed below. Can anyone suggest why I am getting this black bar ?

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

CGFloat width = CGRectGetWidth(self.view.bounds);
CGFloat height = CGRectGetHeight(self.view.bounds);

UIViewController *containerController = [[UIViewController alloc] init];
containerController.contentSizeForViewInPopover = CGSizeMake(width, height);
[imagePickerController.view setFrame:containerController.view.frame];
[containerController.view addSubview:imagePickerController.view];



if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
    Class cls = NSClassFromString(@"UIPopoverController");
    if (cls != nil) {

        popoverController = [[UIPopoverController alloc] initWithContentViewController:containerController];

        [popoverController presentPopoverFromRect:selectedRect inView:self.view permittedArrowDirections:4 animated:YES];

        [containerController release];

    }

Screenshot

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:19:15+00:00Added an answer on May 27, 2026 at 1:19 pm

    For some strange reason, the view’s frame does change in landscape right.

    To come over this, set the frame after you present the popover (view code below).

    That should do the trick.

    imagePickerController = [[UIImagePickerController alloc] init];
    imagePickerController.delegate = self;
    imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    
    CGFloat width = CGRectGetWidth(self.view.bounds);
    CGFloat height = CGRectGetHeight(self.view.bounds);
    
    UIViewController *containerController = [[UIViewController alloc] init];
    containerController.contentSizeForViewInPopover = CGSizeMake(width, height);
    
    [containerController.view addSubview:imagePickerController.view];
    
    
    
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
        Class cls = NSClassFromString(@"UIPopoverController");
        if (cls != nil) {
    
            popoverController = [[UIPopoverController alloc] initWithContentViewController:containerController];
    
            [popoverController presentPopoverFromRect:selectedRect inView:self.view permittedArrowDirections:4 animated:YES];
    
            [imagePickerController.view setFrame:containerController.view.frame];
    
            [containerController release];
    
        }
    

    Also, in your controller, add this to reset the frames when the rotation occurs:

    - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
    
        [imagePickerController.view setFrame:imagePickerController.view.superview.frame];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble showing my view correctly. I have this as my code right
Showing a modal ViewController works fine: UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:myView]; [self.navigationController presentModalViewController:navController
its not showing the right border <th style=border-style:solid; border-right:1px; border-left:0px; border-bottom:0px; border-top:0px;>s </th>
This camera program showing horizontal preview while we are watching vertically like its was
When showing a project, the user can add a decision via a form_for and
This is me showing that I didn't get a CS degree. What I'm wondering
i Showing a progress Bar as a Modal Pop Up.for this i <script type=text/javascript
Im showing a video int my application, but its being chopped up, its locally
Plone is showing the special chars from my mother language (Brazilian Portuguese) in its
My grid isnt showing data when put to tab. This grid, store, model, JSON

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.