modalviewcontroller

UISplitViewController - Pushing Modal View

∥☆過路亽.° 提交于 2019-12-06 03:19:38
问题 What is considered the best practise when pushing a modal view when using a UISplitViewController? Would you push from the RootViewController, the DetailViewController or directly from the Application Delegate? Ideally the functionality I am trying to achieve is to have the modal view controller displayed as soon as the UISplitViewController is loaded based on certain conditions. Thanks in advance for any pointers on this matter. 回答1: I was trying to do the exact same thing, and I've come up

iTunes style modal view controller chain (form sheet)

耗尽温柔 提交于 2019-12-06 02:39:54
Is there a way to achieve the iTunes style modal view controller chain (see screenshot)? I've looked around quite a bit but couldn't find any real questions about this. I'm not looking for a replacement or workaround, just want to know if it is possible to do with the current SDK (or iOS 5.0, although we are not supposed to talk about it a simple Yes/No would suffice). For those who can not make it out from the image; iTunes on the iPad has this great feature where you can view a movie in a formsheet style modalviewcontroller , and if you click on another movie in that same modalviewcontroller

isBeingDismissed not set in viewWillDisappear:

柔情痞子 提交于 2019-12-05 16:57:08
问题 I have some code to clean up in my viewWillDisappear: , which I only want to use when the view is moving back to the parent view controller. - (void)viewWillDisappear:(BOOL)animated { if ([self isMovingFromParentViewController] || [self isBeingDismissed]) { NSLog(@"isMovingFromParentViewController or isBeingDismissed"); // clean up } [super viewWillDisappear:animated]; } The view can be presented in two ways: it can be pushed by a navigation controller, or presented as a modal view controller

present modal form sheet over modal page sheet

▼魔方 西西 提交于 2019-12-05 15:16:12
On the iPad I display a modal view controller with the modalPresentationStyle UIModalPresentationPageSheet. This view controller presents another modal view controller using the modalPresentationStyle UIModalPresentationFormSheet. So, the user sees the background view controller, the page sheet and the form sheet all on top of each other, since the form sheet is smaller than the page sheet. The presentation of the page sheet lets the background dim, so that it can't be interacted with. The form sheet, though, does not dim the page sheet on iOS 5, so that the user can still interact with the

How To Present Half Screen Modal View?

独自空忆成欢 提交于 2019-12-05 10:13:27
I have a UIViewController and when a button is pressed, I want a half screen view to slide up with a UIPicker in it. I made a UIView in IB with the UIPicker along with a UIToolBar with Done/Cancel buttons. How can I make it so that just this half view slides up and the background view is still showing but dimmed or cant be played with. I'm using this code so far: - (void)showModalView { [self.popupView setFrame:CGRectMake(0, self.view.frame.size.height, self.view.frame.size.width, self.view.frame.size.height)]; [self.view addSubview:self.popupView]; [UIView animateWithDuration:.2 animations:^{

iOS: Apply view rotation to view controller under modal view

人盡茶涼 提交于 2019-12-05 10:10:29
I have been following a solution on this question in order to display a view with a transparent background. The issue that I'm having is once the modal view controller has been displayed, the underlying view doesn't get rotated anymore. For example if A is my view controller, then B is my modal view. The issue is as follows. I currently have my device in portrait and have A displayed. I then present B modally. I then rotate my device and B rotates with it, however A stays as it was. Please could someone advise on how to handle this rotation so that the underlying view ( A ) gets rotated too?

Resize ModalViewController and position it at center in iOS 7

百般思念 提交于 2019-12-05 06:20:13
I am trying to show a modalView on an iPad by reducing its width and height, but the problem is that it is not center-aligned. In iOS 6 it used to work fine, but in iOS 7 it is not center aligned. Below is my code: m_helpQA = [[HelpQAViewController alloc]init]; m_helpQA.modalPresentationStyle = UIModalPresentationFormSheet; [self presentViewController:m_helpQA animated:YES completion:NULL]; m_helpQA.view.superview.bounds = CGRectMake(0, 0, 350, 250);//Dimensions of ModalView. presently I am getting it this way For iOS 7 try this: [self.navigationController presentViewController

iOS - Switch between dismiss and scroll gestures

拈花ヽ惹草 提交于 2019-12-04 23:11:13
问题 There's a behavior in the Line messenger app (the de facto messenger app in Japan) that I'm trying to emulate. Basically, they have a modal view controller with a scroll view inside. When the scroll action reaches the top of its content, the view controller seamlessly switches to an interactive dismissal animation. Also, when the gesture returns the view to the top of the screen, control is returned to the scroll view. Here's a gif of how it looks. For the life of me, I can't figure out how

How to resize a modalViewController with UIModalPresentationPageSheet

℡╲_俬逩灬. 提交于 2019-12-04 21:35:05
I've a modal view controller that I show with UIModalPresentationPageSheet. The problem is that his default size is too large for my content: so I want to resize is frame to adjust in according with my content. Does anyone know a way/trick to do this ? Thanks You can't resize a UIModalPresentationPageSheet because its size is not modifable. Hrafn Actually you can resize the view controller that gets presented with UIModalPresentationPageSheet. To do it you need to create a custom view controller class and add the following to the class: <!--The header file--> @interface MyViewController:

how to present modal UIViewController dialog from bottom in IOS like this (image attached)

你。 提交于 2019-12-04 21:06:11
How would one present a UIViewController (from Storyboard say) that is modal, and slides up from the bottom of the presenting view controller. Requirements would be: slides up from bottom, with widths aligning with the width of the presenting view controller does NOT take up whole screen or whole parent presenting view controller (rather only is as high as required to show itself) can be shown within the context of a view controller which doesn't take the whole screen I do not use storyboards so I wrote it all out. You can copy paste this into a brand new project and run it to see it working.