Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/117.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
显示对话框以倒置旋转iOS应用程序_Ios_Dialog_Orientation_Portrait - Fatal编程技术网

显示对话框以倒置旋转iOS应用程序

显示对话框以倒置旋转iOS应用程序,ios,dialog,orientation,portrait,Ios,Dialog,Orientation,Portrait,我正在开发一个应用程序,它必须是颠倒的。 我想向用户显示一个对话框,用户可以接受(这将导致自动旋转)或拒绝 如何使用objective-c显示这样的对话框? 我需要检查info.plist中的纵向模式以及支持的界面方向中的编程模式。对吧? 非常感谢您的帮助 为此使用UIAlertController UIAlertController * alert=[UIAlertController alertControllerWithTitle:@"Title" message:@"Message"

我正在开发一个应用程序,它必须是颠倒的。 我想向用户显示一个对话框,用户可以接受(这将导致自动旋转)或拒绝

如何使用objective-c显示这样的对话框? 我需要检查info.plist中的纵向模式以及支持的界面方向中的编程模式。对吧?


非常感谢您的帮助

为此使用UIAlertController

UIAlertController * alert=[UIAlertController 

alertControllerWithTitle:@"Title" message:@"Message"preferredStyle:UIAlertControllerStyleAlert];

   UIAlertAction* yesButton = [UIAlertAction
                        actionWithTitle:@"Yes, please"
                        style:UIAlertActionStyleDefault
                        handler:^(UIAlertAction * action)
                        {
                            **//What we write here????????**


                      NSLog(@"you pressed Yes, please button");
                     // call method whatever u need
                        }];
   UIAlertAction* noButton = [UIAlertAction
                            actionWithTitle:@"No, thanks"
                           style:UIAlertActionStyleDefault
                           handler:^(UIAlertAction * action)
                           {
                               **//What we write here????????**


                      NSLog(@"you pressed No, thanks button");
                       // call method whatever u need

                           }];

   [alert addAction:yesButton];
   [alert addAction:noButton];

   [self presentViewController:alert animated:YES completion:nil];`

非常感谢你的回答。我当然会的。不幸的是,我被困在旋转看到了吗