UIPopoverController automatically resizing to max height on pushViewController

后端 未结 13 691
感情败类
感情败类 2020-12-07 10:45

I have a popover containing a UINavigationController. I can display the popover fine, and it contains the navController just fine. The navController contains a tableView a

13条回答
  •  渐次进展
    2020-12-07 11:24

    This fixed it for me after I had the same issue (coincidently also today):

    EDIT : As contentSizeForViewInPopover is deprecated in iOS7.0 so use preferredContentSize.

    Original answer below:

    In your detailViewController add this:

    - (void)viewWillAppear:(BOOL)animated {
    
        CGSize size = CGSizeMake(320, 480); // size of view in popover
        self.contentSizeForViewInPopover = size;
    
        [super viewWillAppear:animated];
    
    }
    

    You also want to add something similar to your original DeviceDetailViewController to prevent resizing when tapping the back NavbarItem.

提交回复
热议问题