modalviewcontroller

Stop a modal UIViewController from rotating

假如想象 提交于 2019-12-01 05:12:07
问题 The modal UIViewController 's parent auto-rotates, but when the modal VC is up I only want it to appear in portrait and not be rotatable. I have tried simply returning NO from shouldAutorotate ... in the modal VC, but no joy. Supporting iOS 5+. Any help greatly appreciated. 回答1: Basically, if you presenting Modal Controller on Any Container Controllers (i.e. UINavigationController) it have autorotation method return YES by default. So you have to make subclass for your UINavigation Controller

UIModalTransitionStyle horizontal movement

亡梦爱人 提交于 2019-12-01 00:24:35
The UIModalTransitionStyle is either Vertical, Flip or Dissolve. I would like it to be right to left or left to right, like if you click on a disclosure button on a MapKit callout or in a navigation based app. This is impossible as transition for a modal viewController, but you could use a CATransition with a type of kCATransitionMoveIn or kCATransitionPush and a subtype of kCATransitionFromRight CATransition* trans = [CATransition animation]; trans.type = kCATransitionPush; trans.subtype = kCATransitionFromRight; trans.duration = 0.5; [newView.layer addAnimation:trans forKey:@

Adding a UIActivityIndicator to a modal view (ELCimagepicker)

∥☆過路亽.° 提交于 2019-11-30 23:30:37
I've added the ELCimagepicker (https://github.com/Fingertips/ELCImagePickerController) to my project and it works perfectly, allowing the user to select multiple images for a slideshow. But when you click 'Save', there can be a lengthy delay depending on how many photos were added. I've been trying to add a UIActivityIndicator when the user clicks 'Save', but having trouble due to the modal view that is presented. I can call a method from the activity that ELCimagepicker presents (ELCImagePickerController) and this gets actioned by the activity handling the presenting of the image picker. But

How to use modal views in swift?

旧时模样 提交于 2019-11-30 21:33:13
When adding an account to Mail (in preferences), you get a modal view, like this: My question is, how do I replicate this programatically? In other words, how do I display a modal UIView over a presenting view? Here's what I have: import UIKit class ViewController: UIViewController { @IBAction func addCard(sender: AnyObject) { var addContact : secondViewController = secondViewController() self.modalTransitionStyle = UIModalTransitionStyle.FlipHorizontal self.modalPresentationStyle = .CurrentContext // Display on top of current UIView self.presentViewController(addContact, animated: true,

Adding a UIActivityIndicator to a modal view (ELCimagepicker)

你。 提交于 2019-11-30 18:32:11
问题 I've added the ELCimagepicker (https://github.com/Fingertips/ELCImagePickerController) to my project and it works perfectly, allowing the user to select multiple images for a slideshow. But when you click 'Save', there can be a lengthy delay depending on how many photos were added. I've been trying to add a UIActivityIndicator when the user clicks 'Save', but having trouble due to the modal view that is presented. I can call a method from the activity that ELCimagepicker presents

Create and Present modal view controller programmatically

删除回忆录丶 提交于 2019-11-30 18:11:02
问题 I am trying to programmatically declare a modal view controller from a view controller launched using storyboard. I would expect to see a blank view coming up but instead I only see the webview from the first controller. - (void)viewDidLoad { [super viewDidLoad]; NSString *fullURL = @"http://google.com"; NSURL *url = [NSURL URLWithString:fullURL]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; _viewWeb.delegate=self; [_viewWeb loadRequest:requestObj]; modalViewController=[

iOS5: Exception on UIWebView in modal UIViewController playing Youtube video

懵懂的女人 提交于 2019-11-30 17:12:22
UPDATE: No longer occurs on iOS 6 beta 1 I am currently working on adapting an existing iOS 4 application with the new iOS 5 SDK. I found a new crash when presenting a UIWebView in a modal view controller that reads a Youtube video. Starting to read the video is fine, but when I try to set it in full screen, I get the following exception : Exception: UIViewControllerHierarchyInconsistency, child view controller:<UIViewController: 0x6aef180> should have parent view controller:<WebViewController: 0x6a706c0> but requested parent is:<MPInlineVideoViewController: 0x6ae5d40> Here is how I

why does this code use presentModalViewController? (not pushViewController)

痞子三分冷 提交于 2019-11-30 15:57:29
Anyone understand why in the CoreDataBooks example code that: (a) method for controller swapping difference Whilst the click an item and go to detailed view uses what seems to be the standard UINavigationController concept of " pushViewController ", that when when you click on the "Add" a new record button it launches the new view to add the record via " presentModalViewController " approach? That is, couldn't the approach have been the same in both cases, just using a pushViewController approach? Are there actually any advantages to using each approach for where it's been used? I can't quite

why does this code use presentModalViewController? (not pushViewController)

大憨熊 提交于 2019-11-30 15:53:17
问题 Anyone understand why in the CoreDataBooks example code that: (a) method for controller swapping difference Whilst the click an item and go to detailed view uses what seems to be the standard UINavigationController concept of " pushViewController ", that when when you click on the "Add" a new record button it launches the new view to add the record via " presentModalViewController " approach? That is, couldn't the approach have been the same in both cases, just using a pushViewController

How to change UIStatusBarStyle in iOS 7 in modal views with navigation bar?

青春壹個敷衍的年華 提交于 2019-11-30 08:54:35
The iOS 7 Transition Guide give a good hint how to change the UIStatusBarStyle dynamically in a UIViewController using - (UIStatusBarStyle)preferredStatusBarStyle { return UIStatusBarStyleDefault; } together with [self setNeedsStatusBarAppearanceUpdate]; This works fine in a single view application. However, I'm now trying to change the UIStatusBarStyle in a modal view to UIStatusBarStyleLightContent . There is a MainViewController which segues to the ModalViewController , which itself is embedded in a NavigationController . The ModalViewController has set its delegate to the