我有一个视图控制器上有一个按钮.该按钮是隐私政策.当它被点击它去适当的IBAction并且我创建隐私控制器.
- IBAction ... { PrivacyPolicyViewController *privacy = [[PrivacyPolicyViewController alloc] init]; ..... }
我想创建一个隐私控制器的模态视图,该视图具有一个UIWebView,它可以自动向上弹出,并在ios 7中关闭它的后退按钮.我在线看到的方式都是ios 6,似乎已被弃用.
解决方法
使用这样的东西:
// assuming your controller has identifier "privacy" in the Storyboard UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; PrivacyPolicyViewController *privacy = (PrivacyPolicyViewController*)[storyboard instantiateViewControllerWithIdentifier:@"privacy"]; // present [self presentViewController:privacy animated:YES completion:nil]; // dismiss [self dismissViewControllerAnimated:YES completion:nil];