uimodalpresentationstyle

How do I hide the status bar in an iOS app without causing the UINavigationBar to jump?

放肆的年华 提交于 2019-12-11 16:48:25
问题 I have a view controller that needs to hide the status bar before presenting a modal and after that modal is dismissed. This is not as simple as overriding prefersStatusBarHidden and then setting modalPresentationCapturesStatusBarAppearance because that will also cause a jump given I am presenting over the current context (the modal is a pull down to dismiss). Consider the instagram story UX, as an example. When tapping on a story, you actually see the status bar disappear before the story

Swift Long Delay Between viewDidLoad and viewWillAppear

陌路散爱 提交于 2019-12-11 15:48:12
问题 I'm encountering an problem where I am having a long delay when trying to present a ViewController . I am trying to display an upgrade alert when a user clicks on a UITableViewCell which requires premium access. In the ViewController being presented, I put debug code: override func viewDidLoad() { super.viewDidLoad() println("\(NSDate()) viewDidLoad") // Set Navigation Title font and color self.navigationController?.navigationBar.titleTextAttributes = [NSFontAttributeName: UIFont(name:

Crash after presenting View Controller modal on iPhone

依然范特西╮ 提交于 2019-12-11 10:06:14
问题 I´m trying to implement a Popover for iPad and iPhone. Before iOS 9, there were different ViewController for iPad and iPhone. With iOS9 there should be a possibility to do this with a normal ViewController and different PresentationStyles? (Deployment Target is iOS 9.0) Am i right? according to this post: Stackoverflow answer from Daniel Galasko I tried to implement this answer in objective c. _mediaTypePopoverVC = [[MediaTypePopoverVC alloc] initWithProductId:PRODUCT_ID_NONE_PARENT];

How to redraw my view in SWIFT?

青春壹個敷衍的年華 提交于 2019-12-11 09:46:52
问题 On my iPad app, I have a UIViewController with a button that open a modalView. @IBAction func showPostCommentViewController(sender: AnyObject){ let modalView = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("PostCommentViewController") as! PostCommentViewController modalView.modalTransitionStyle = UIModalTransitionStyle.CoverVertical modalView.modalPresentationStyle = UIModalPresentationStyle.FormSheet modalView.delegate=self self.presentViewController

viewDidAppear and viewDidDisappear not called when modalPresentationStyle=UIModalPresentationCustom

≯℡__Kan透↙ 提交于 2019-12-08 12:59:34
问题 I need to do a custom presentation animation and when i set both these setTransitioningDelegate and modalPresentationStyle=UIModalPresentationCustom The animation is perfect with unless the viewDidAppear and viewDidDisappear is not called in the presenting viewcontroller.This is same for Apple sample code in https://developer.apple.com/library/ios/samplecode/LookInside/Introduction/Intro.html [overlay setTransitioningDelegate:[self transitioningDelegate]]; overlay.modalPresentationStyle

How to use modalPresentationCapturesStatusBarAppearance = NO with a custom UIPresentationController?

半腔热情 提交于 2019-12-07 10:17:16
问题 I have a custom UIPresentationController and overrides frameOfPresentedViewInContainerView for a custom viewController presentation. Everything works fine, except for the status bar. I do not want the status bar to change appearance at all – it should just stay however it looked before. Now the Apple Documentation: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/#//apple_ref/occ/instp/UIViewController/modalPresentationCapturesStatusBarAppearance

How to resize a modalViewController with UIModalPresentationPageSheet

主宰稳场 提交于 2019-12-06 13:28:00
问题 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 回答1: You can't resize a UIModalPresentationPageSheet because its size is not modifable. 回答2: Actually you can resize the view controller that gets presented with UIModalPresentationPageSheet. To do it you need to create a custom view

UIPopoverPresentationController is showing full screen modal on iPhone

风流意气都作罢 提交于 2019-12-06 09:21:57
问题 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

How to present a semi-transparent (half-cut) viewcontroller in iOS 8

核能气质少年 提交于 2019-12-05 23:18:59
问题 in iOS 7 there is no problem for this method: _rootViewController.modalPresentationStyle = UIModalPresentationCurrentContext; [_rootViewController presentViewController:self animated:NO completion:nil]; But in iOS 8 it did nothing.How to solve it? Is it a Bug for iOS 8? 回答1: My answer is more simple, below code. This works in iOS8 (XCode6 GM seed). HogeViewController *vc = [[HogeViewController alloc] init]; vc.modalPresentationStyle = UIModalPresentationOverFullScreen; [self

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: