presentmodalviewcontroller

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=[

Pass value to parent controller when dismiss the controller

旧城冷巷雨未停 提交于 2019-11-30 17:41:40
问题 I want to send data to parentviewcontroller but the following code crashes. Give me the solution Post *vc; vc.abc =@"Comment Conttroller"; [self.parentViewController dismissModalViewControllerAnimated:YES]; Here, Post is the controller name from where I am calling the presentViewController:animated:completion method. 回答1: vc doesn't seem to be initialized. You can probably do this, vc = (Post *)self.parentViewController; vc.abc = @"Comment Conttroller"; [vc dismissModalViewControllerAnimated

Why can’t UIImagePickerController be pushed into navigation stack?

别等时光非礼了梦想. 提交于 2019-11-30 17:16:36
When using pushViewController to push UIImagePickerController : [self.navigationController pushViewController:pvc animated:YES]; an error will occur such as: Pushing a navigation controller is not supported The right solution is to use presentModalViewController : [self presentModalViewController:pvc animated:YES]; Can someone explain why this is necessary? What‘s hidden in UIViewController ? Thanks! Apple does not allow stacking of navigation bars. Since the image picker has its own navigation bar, it cannot be placed in a navigation stack. The result would cause user confusion since there

Present multiple modal view controllers?

和自甴很熟 提交于 2019-11-30 04:57:32
update: I've faced this problem again, and found another way. If presenting controller is not embedded in navigation controller, it will be hidden if presented controller is not fullscreen and will became black. Method setModalPresentationStyle:UIModalPresentationCurrentContext can be applied only to navigation controller. So embed presenting controller in UINavigationController, set UIModalPresentationCurrentContext to it and present new controller - you will get dialog controller. I'm presenting search controller, it have tableView that push on stack detailed controller. Detailed controller

Why can’t UIImagePickerController be pushed into navigation stack?

你说的曾经没有我的故事 提交于 2019-11-30 00:50:32
问题 When using pushViewController to push UIImagePickerController : [self.navigationController pushViewController:pvc animated:YES]; an error will occur such as: Pushing a navigation controller is not supported The right solution is to use presentModalViewController : [self presentModalViewController:pvc animated:YES]; Can someone explain why this is necessary? What‘s hidden in UIViewController ? Thanks! 回答1: Apple does not allow stacking of navigation bars. Since the image picker has its own

Animate presentModalViewController from right /left

ⅰ亾dé卋堺 提交于 2019-11-29 19:27:44
Currently I am using [self presentModalViewController :newVC animated:YES] .I want to present newViewcontroller from left/right/top/bottom with a push effect. I tried to use CATransition but it displays a black screen in between the transition. wcrane When present: CATransition *transition = [CATransition animation]; transition.duration = 0.3; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; transition.type = kCATransitionPush; transition.subtype = kCATransitionFromRight; [self.view.window.layer addAnimation:transition forKey:nil]; [self

Application tried to present modally an active controller

给你一囗甜甜゛ 提交于 2019-11-29 12:00:48
I have searched for and found various q/a on this error, but have not been able to find any specific help for my issue (at least that my minimal experience allows me to understand). I am loading a UIView from the app's main menu, which in turn has several button options (call it submenu). One of these goes back to the main menu without issue ( [self dismissModalViewControllerAnimated:YES]; ). Another button loads a UITableView (separate view controller), which loads fine. However, I want a button within this UITableView to go back to the submenu. When I use the above mentioned code, it goes

Present multiple modal view controllers?

末鹿安然 提交于 2019-11-29 03:06:03
问题 update: I've faced this problem again, and found another way. If presenting controller is not embedded in navigation controller, it will be hidden if presented controller is not fullscreen and will became black. Method setModalPresentationStyle:UIModalPresentationCurrentContext can be applied only to navigation controller. So embed presenting controller in UINavigationController, set UIModalPresentationCurrentContext to it and present new controller - you will get dialog controller. I'm

presentViewController and displaying navigation bar

陌路散爱 提交于 2019-11-28 16:02:33
I have a view controller hierarchy and the top-most controller is displayed as a modal and would like to know how to display the navigation bar when using 'UIViewController:presentViewController:viewControllerToPresent:animated:completion' The docs for 'presentViewController:animated:completion:' note: 'On iPhone and iPod touch, the presented view is always full screen. On iPad, the presentation depends on the value in the modalPresentationStyle property.' For 'modalPresentationStyle', the docs say: The presentation style determines how a modally presented view controller is displayed onscreen

iOS 7 Translucent Modal View Controller

偶尔善良 提交于 2019-11-28 15:00:43
The App Store app on iOS 7 uses a frosted glass-type effect where it is possible to see the view behind. Is this using an API built into iOS 7 or is it custom code. I was hoping it would be the former but I can't see any obvious references in the documentation. Obvious things like (like setting the alpha property on the modal view) don't seem to have any effect. To see an example, open the App Store app and press the button at the top-right. Sebastian Hojas With the release of iOS 8.0, there is no need for getting an image and blurring it anymore. As Andrew Plummer pointed out, you can use