在View Controller之上添加SLComposeServiceViewController

时间:2014-11-11 20:38:24

标签: ios objective-c uiviewcontroller

我试图在我现有的视图控制器上呈现SLComposeServiceViewController,它是一个包含地图的导航控制器。当我展示SLComposeServiceViewController时,它会显示黑色背景并将其覆盖在我现有的视图上。

我使用的代码是:

SLComposeServiceViewController *composeVC = [[SLComposeServiceViewController alloc]init];

composeVC.placeholder = @"Enter your post";
[self presentViewController:composeVC animated:YES completion:nil];

这是我所看到的一个例子

enter image description here

如何在现有视图的顶部显示视图?

1 个答案:

答案 0 :(得分:8)

  SLComposeServiceViewController *composeVC = [[SLComposeServiceViewController alloc]init];

composeVC.placeholder = @"Enter your post";
composeVC.modalPresentationStyle = UIModalPresentationStyleOverCurrentContext;
[self presentViewController:composeVC animated:YES completion:nil];