presentmodalviewcontroller

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

How to present a modal view in sprite kit?

*爱你&永不变心* 提交于 2019-12-05 00:10:07
问题 How can I use Game Center or the GameKit Framework with a Sprite Kit Xcode template? In Sprite kit, it uses Scenes; but normally to view the leaderboards for example you need to "presentModalViewController" but that is not possible in SKView. Thanks in advance! 回答1: Smick pointed me in the right direction for a similar problem I was having. I needed to send a message to the main ViewController from my SKScene. This did it for me: In your SKScene, import the ViewController #import

MFMailComposeViewController crashing while dismissModalViewControllerAnimated in iOS5

血红的双手。 提交于 2019-12-04 09:31:33
I am using MFMailComposeViewController in my conde to provide Mail functionality but after sending mail or when i want to cancel mail it will be crashing. below is my code: (IBAction)FnForPlutoSupportEmailButtonPressed:(id)sender { { if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init]; mailer.mailComposeDelegate = self; [mailer setSubject:@"Need help from Pluto support team"]; NSArray *toRecipients = [NSArray arrayWithObjects:@"support@myplu.to",nil]; [mailer setToRecipients:toRecipients]; NSString *emailBody = @"";

What is the difference between addChildViewController and presentModelViewController

China☆狼群 提交于 2019-12-04 02:12:27
I know there are three ways to change the view in iOS 1. [self addChildViewController:thirdViewController]; [contentView addSubview:thirdViewController.view]; 2. First * sVC = [[First alloc] initWithNibName:@"First" bundle:[NSBundle mainBundle]]; [self presentModalViewController:sVC animated:YES]; 3. MyViewController *sampleViewController = [[[MyViewController alloc]initWithXXX] autorelease]; [self.navigationController pushViewController: sampleViewController animated:true]; pushViewController requires the navigation controller, which I understand. However, when to use addChildViewController

How to present a modal view in sprite kit?

白昼怎懂夜的黑 提交于 2019-12-03 15:33:42
How can I use Game Center or the GameKit Framework with a Sprite Kit Xcode template? In Sprite kit, it uses Scenes; but normally to view the leaderboards for example you need to "presentModalViewController" but that is not possible in SKView. Thanks in advance! Smick pointed me in the right direction for a similar problem I was having. I needed to send a message to the main ViewController from my SKScene. This did it for me: In your SKScene, import the ViewController #import "MyViewController.h" Then send it a message: [(MyViewController *)self.view.window.rootViewController myMethod]; You

iPhone: How to do a presentModalViewController animation from left to right

余生颓废 提交于 2019-12-03 09:20:38
问题 I am presenting a model view with animation. As a default it comes from bottom to top. How can I make the animation to go from left to right? I know I could use a navigation controller. But actually the presenting view does not need a navigation bar and also the modally presented view does not need a navigation bar. Still I want a transition from left to right. 回答1: There are only four UIModalTransitionStyle s: UIModalTransitionStyleCoverVertical UIModalTransitionStyleFlipHorizontal

Presenting a modal controller without knowing the current view controller?

◇◆丶佛笑我妖孽 提交于 2019-12-03 07:48:08
问题 Is there a way to present a view controller modally without knowing what the visible view controller view is? Basically sort of like you would show an alert view at any points in time. I would like to be able to do something like: MyViewController *myVC = [[MyViewController alloc] init]; [myVC showModally]; I'd like to be able to call this from anywhere in the app, and have it appear on top. I don't want to care about what the current view controller is. I plan to use this to show a login

iPhone: How to do a presentModalViewController animation from left to right

孤街醉人 提交于 2019-12-02 23:44:21
I am presenting a model view with animation. As a default it comes from bottom to top. How can I make the animation to go from left to right? I know I could use a navigation controller. But actually the presenting view does not need a navigation bar and also the modally presented view does not need a navigation bar. Still I want a transition from left to right. There are only four UIModalTransitionStyle s: UIModalTransitionStyleCoverVertical UIModalTransitionStyleFlipHorizontal UIModalTransitionStyleCrossDissolve UIModalTransitionStylePartialCurl Like you said, a nav controller will push that

Presenting a modal controller without knowing the current view controller?

时光怂恿深爱的人放手 提交于 2019-12-02 20:31:49
Is there a way to present a view controller modally without knowing what the visible view controller view is? Basically sort of like you would show an alert view at any points in time. I would like to be able to do something like: MyViewController *myVC = [[MyViewController alloc] init]; [myVC showModally]; I'd like to be able to call this from anywhere in the app, and have it appear on top. I don't want to care about what the current view controller is. I plan to use this to show a login prompt. I don't want to use an alert view, and I also don't want to have login presentation code

How to prevent present modally an active controller?

落花浮王杯 提交于 2019-12-01 03:11:37
We have 2 controllers: MainVC and ProfileVC. From MainVC we go to ProfileVC with profileButton press (left item on navigation bar). In Profile VC we have 2 buttons on navigation bar : back to main (leftItem) and open an alertView (rightItem). So there is simple KIF test (just eternal left-right taps on navigation bar): - (void)testProfileButtons { [tester waitForAnimationsToFinishWithTimeout:0.3]; while (true) { [tester tapScreenAtPoint:CGPointMake(20, 20)]; [tester waitForTimeInterval:0.1]; [tester tapScreenAtPoint:CGPointMake(380, 20)]; [tester waitForTimeInterval:0.1]; [tester