modalviewcontroller

Override horizontally compact environment behaviour for modalPresentationStyle of '.formSheet'

廉价感情. 提交于 2020-07-22 12:30:50
问题 When presenting a UIViewController with modalPresentationStyle = .formSheet , Horizontally compact environment behaves same as UIModalPresentationStyle.fullScreen According to Apple's Documentation UIModalPresentationStyle.formSheet. In a horizontally regular environment, the view controller is sized so that its content area is smaller than the screen size and a dimming view is placed underneath the content. If the device is in a landscape orientation and the keyboard is visible, the position

SwiftUI transition from modal sheet to regular view with Navigation Link

天大地大妈咪最大 提交于 2020-06-17 09:51:09
问题 I'm working with SwiftUI and I have a starting page. When a user presses a button on this page, a modal sheet pops up. In side the modal sheet, I have some code like this: NavigationLink(destination: NextView(), tag: 2, selection: $tag) { EmptyView() } and my modal sheet view is wrapped inside of a Navigation View. When the value of tag becomes 2, the view does indeed go to NextView(), but it's also presented as a modal sheet that the user can swipe down from, and I don't want this. I'd like

Modal viewcontroller UI not responsive after presentViewController:animated:completion:

大憨熊 提交于 2020-02-25 04:40:08
问题 My app has a root viewcontroller, which at the start of the app displays login viewController view if the user is not logged in main viewController view if the user is logged in AppDelegate code: - (BOOL) application: (UIApplication*) application didFinishLaunchingWithOptions: (NSDictionary*) launchOptions { self.window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; self.window.rootViewController = [[RootViewController alloc] init]; [self.window makeKeyAndVisible]; return

Modal viewcontroller UI not responsive after presentViewController:animated:completion:

拜拜、爱过 提交于 2020-02-25 04:38:31
问题 My app has a root viewcontroller, which at the start of the app displays login viewController view if the user is not logged in main viewController view if the user is logged in AppDelegate code: - (BOOL) application: (UIApplication*) application didFinishLaunchingWithOptions: (NSDictionary*) launchOptions { self.window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; self.window.rootViewController = [[RootViewController alloc] init]; [self.window makeKeyAndVisible]; return

iOS 7: Keyboard not showing after leaving modal ViewController

不羁的心 提交于 2020-01-25 11:52:28
问题 I've got a HomeViewController that has different modal segues to several other UIViewControllers . If I try to show the keyboard on a UITextField within the HomeView, everything works fine. However, if I try to show the keyboard on a UITextField (using becomeFirstResponder ) after returning from any of the modal View Controllers, the keyboard never shows. Here's some sample code from one of the setups I've tried: In HomeViewController : - (void)viewDidAppear:(BOOL)animated { static BOOL

iOS 7: Keyboard not showing after leaving modal ViewController

戏子无情 提交于 2020-01-25 11:51:23
问题 I've got a HomeViewController that has different modal segues to several other UIViewControllers . If I try to show the keyboard on a UITextField within the HomeView, everything works fine. However, if I try to show the keyboard on a UITextField (using becomeFirstResponder ) after returning from any of the modal View Controllers, the keyboard never shows. Here's some sample code from one of the setups I've tried: In HomeViewController : - (void)viewDidAppear:(BOOL)animated { static BOOL

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

Multiple Modally Presented (page sheet) ViewControllers Navigation Item Bug

不羁岁月 提交于 2020-01-17 14:04:06
问题 iOS 13. The problem is shown on the screenshot. The steps are: Open one view controller modally with page sheet style. Open another (second) view controller modally with page sheet style. Expected: no Nav Bar bug Actual: see screenshot The source code is available here: https://github.com/rinat-enikeev/NavBarBug Question: how to fix this bug? I want to present 2 view controllers modally with page sheet style. 回答1: Ok, for those who faced the same issue. The workaround is to add the following

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

Dismiss modal view controller on application exit

会有一股神秘感。 提交于 2020-01-16 00:52:05
问题 I have a view controller (view A) presenting a modal view (B) when the user pushed a button and the view B has itself a button to present view C. My problem is that if the user exits the application when the view B or C is shown, the same view will appear next time the application is launched. Is there a way to dismiss the views B and C on exit or to show view A when the application starts? Thanks for your help 回答1: I assume by close you mean when the application enters the background. In