uimodalpresentationstyle

Using definesPresentationContext with UIModalPresentationStyle.custom

放肆的年华 提交于 2021-02-06 10:46:06
问题 I am using view controller containment to manage a set of child view controllers which should be able to modally present other view controllers in a custom manner. I have run into an issue where the definesPresentationContext property is not used when a presenting from a view controller using UIModalPresentationStyle.custom As an example, I have three view controllers: ROOT , A , and B ROOT |_ A A is the child of ROOT . I would like to present B modally from A while using custom

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

霸气de小男生 提交于 2020-01-23 01:24:47
问题 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

Notification when view controller is presented modally/dismissed?

谁说我不能喝 提交于 2020-01-17 05:16:27
问题 Is there any way to be notified automatically if some view controller is presented modally on top of another view controller (other than viewWillDisappear , which is obviously not called for non-fullscreen modal presentation on iPad)? Background/use case: In an iPad app, whenever a modal form sheet is presented, I want to adjust the appearance of the view behind the modal. However, the presentation if the modals is not necessarily done in the same view controller that needs to adapt, but can

iPad - Dismiss keyboard for modal view controller in UIModalPresentationFormSheet mode

五迷三道 提交于 2020-01-06 05:23:35
问题 In my iPad app I want to present some view controllers in UIModalPresentationFormSheet modal mode without keyboard . I use it to display help as an example. At the moment I use the code found on the one of stackoverflow answers to dismiss it: // trick to dismiss keyboard in iPad: if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){ // iPad specific behaviour: @try { Class UIKeyboardImpl = NSClassFromString(@"UIKeyboardImpl"); id activeInstance = [UIKeyboardImpl performSelector:@selector

Cannot Get Unwind Segue Working with Modal View Controller Presented Over Current Context

江枫思渺然 提交于 2019-12-25 12:27:05
问题 This is regarding the latest version Xcode 6 and iOS 8.4. I have a set of three view controllers, which VC2 & VC3 are presented modally: VC1 -> VC2 -> VC3 Each of the segues are presented with a presentation style of .OverCurrentContext . I am using this presentation style because both VC2 & VC3 have a UIVisualEffectView with a blurred background to let the view underneath subtly show through. My issue is that the unwind segue that I have created does not unwind neither VC2 or VC3 to VC1 with

PresentModalViewController with some frame

牧云@^-^@ 提交于 2019-12-23 03:51:24
问题 I want to present a modalViewController with a small frame and at the center of the view. Is that possible? Even if I set some frame to the viewController object, presentModelViewController is displaying that view in full screen mode. Also, I have used modalPresentationStyle as UIModalPresentationFormSheet . I want to have frame even smaller than that. How to do that? 回答1: You cannot present a modal view controller that has a smaller frame size. what you can try doing is to set the background

iOS 13 presentation style default

我的梦境 提交于 2019-12-20 03:31:49
问题 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... 回答1: Unfortunately there is no global variable to override to change this

presentModalViewController fullscreenmode issue

蓝咒 提交于 2019-12-19 04:57:07
问题 I'm trying to present this modalViewController in my app and it needs to be fullscreen. This is how I call up the ModalViewController. myViewController = [[MyViewController alloc] init]; //self.myViewController.SomeView = [[UIView alloc] init]; //self.myViewController.SomeView.frame = self.ThisView.frame; //self.myViewController.backButtonEnabled = NO; //self.myViewController.dismissDelegate = self; //[self.myViewController doLoadShizzle]; //do this to load view and stuffs as well //all

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

一个人想着一个人 提交于 2019-12-18 12:45:40
问题 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

UIModalPresentationCurrentContext with Transition?

孤街浪徒 提交于 2019-12-17 22:44:16
问题 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