uimodalpresentationstyle

UIPopoverPresentationController is showing full screen modal on iPhone

纵然是瞬间 提交于 2019-12-04 17:16:49
On iPad UIPopoverPresentationController working fine but on iPhone it is always showing full window modal popup. i am using following code: UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; MySecondViewController *contentVC = [storyboard instantiateViewControllerWithIdentifier:@"Pop"]; contentVC.modalPresentationStyle = UINavigationControllerOperationPop; // 13 UIPopoverPresentationController *popPC = contentVC.popoverPresentationController; // 14 contentVC.popoverPresentationController.sourceRect =CGRectMake(100, 130, 280, 230); self.navigationController

How can I find portion of my view which isn't covered by the keyboard (UIModalPresenationStyleFormSheet)?

ぃ、小莉子 提交于 2019-12-04 09:54:15
I've got a view controller showing a view with a UITextView, and I want to resize the view when the keyboard appears so that the UITextView isn't covered by the keyboard. I have this working correctly in almost all cases. I'm still seeing some weirdness on the iPad, only when the view controller is presented in ModalPresentationStyleFormSheet, and only in LandscapeRight orientation, as far as I can tell. Relevant parts of my view controller's -keyboardWillShow: // We'll store my frame above the keyboard in availableFrame CGRect availableFrame = self.view.frame; // Find the keyboard size

Rounding corners of UIModalPresentationFormSheet

浪尽此生 提交于 2019-12-03 14:08:37
问题 forgive me if this is an obvious question i am relatively new. I have a modal view which i set up with a custom size and rounded corners: - (void)viewWillLayoutSubviews{ [super viewWillLayoutSubviews]; self.view.superview.bounds = CGRectMake(0, 0, 600, 450); self.view.layer.cornerRadius = 60.0; } However i find that when i round the view corners, i get this greyish colour appear on the edges of it (as if theres something else behind it) : (see picture). How do i remove these greyish edges so

Popover with ModalPresentationStyle is not centered in iOS 7 iPad

北慕城南 提交于 2019-12-03 04:20:40
问题 I have a problem with iOS 7 that seems to be a bug or I just don't do something right. I have modalViewController that appears as a popover on iPad with ModalPresentationStyle. And it is not standard size, custom sized. Here is the code: myViewController *myVC = [[myViewController alloc] init]; UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:myVC]; [nav setModalPresentationStyle:UIModalPresentationFormSheet]; [nav setModalTransitionStyle:

UITabBarController's viewControllers present modal controller issue

你说的曾经没有我的故事 提交于 2019-12-02 19:37:42
问题 I have a UITabBarController with 4 viewControllers setup. One of the controller has a button that present another controller (wrapped on UINavigationController) with the following setup: self.definesPresentationContext = true navController.modalPresentationStyle = .overCurrentContext navController.modalTransitionStyle = .crossDissolve self.present(navController, animated: true) Until this point is working fine. Now if I switch to another tab (while the previous modal is open), and return

UITabBarController's viewControllers present modal controller issue

不打扰是莪最后的温柔 提交于 2019-12-02 09:40:50
I have a UITabBarController with 4 viewControllers setup. One of the controller has a button that present another controller (wrapped on UINavigationController) with the following setup: self.definesPresentationContext = true navController.modalPresentationStyle = .overCurrentContext navController.modalTransitionStyle = .crossDissolve self.present(navController, animated: true) Until this point is working fine. Now if I switch to another tab (while the previous modal is open), and return again to the tab that presented the modal (The screen is still there, that's ok). Then if i close the modal

iOS 13 presentation style default

本小妞迷上赌 提交于 2019-12-02 01:22:54
In my iOS app I have about 60 present(_:animate:complition) calls from legacy code. iOS 13 just changed the default presentationStyle to Automatic which actually means .formSheet style. Is there a quick way to change the default back to .fullScreen on all the app? maybe like in the infoPlist or some global protocol like UIAppearance Protocol? If there's no way i need to set the presentationStyle manually in 60 places... Unfortunately there is no global variable to override to change this. This is all part of updating for the new OS's! Embrace the change, and change them all manually. This

UIModalPresentationPopover for iPhone 6 Plus in landscape doesn't display popover

房东的猫 提交于 2019-11-30 16:51:24
I want to always present a ViewController in a popover on all devices and all orientations. I tried to accomplish this by adopting the UIPopoverPresentationControllerDelegate and setting the sourceView and sourceRect . This works very well for all devices and orientations, except the iPhone 6 Plus in landscape. In that case the view controller slides up from the bottom of the screen in a form sheet. How can I prevent that so that it will always appear in a popover? override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { let popoverPresentationController = segue

UIModalPresentationCurrentContext with Transition?

别说谁变了你拦得住时间么 提交于 2019-11-28 19:45:14
I am trying to modal present a view controller like below: UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"addPopover"]; vc.view.backgroundColor = [UIColor clearColor]; self.modalPresentationStyle = UIModalPresentationCurrentContext; [self presentModalViewController:vc animated:YES]; Now using UIModalPresentationCurrentContext means I can present this view with a transparent background and see my other view behind the new one. However, it stops me from being able to present

How to present a modal view controller with custom size in center?

两盒软妹~` 提交于 2019-11-28 03:19:16
问题 I want to present a custom-sized modal view controller with animation from the bottom. I can achieve this animation with ModalPresentationStyle to FormSheet , but it forces me to use the default size which is 540x620 and my view doesn't fit. How do I make perform a similar transition to an arbitrarily sized view (controller) placed in center of the screen? 回答1: I didn't find a way to do it from the modal controller itself so I created a class and an extension method: public class