【发布时间】:2015-09-03 16:27:46
【问题描述】:
我正在将 SLService for Twitter 集成到应用程序中。它在 iPhone 上运行良好,但在 iPad 上消失了。
我已经在 iPad 上集成:
[actionSheet showFromRect:self.myRect inView:self.tableView animated:YES];
而不是:
[actionSheet showInView:[UIApplication sharedApplication].keyWindow];
iPad有没有类似的方法代替presentViewContoller: Animated:?
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
SLComposeViewController *tweetSheet = [SLComposeViewController
composeViewControllerForServiceType:SLServiceTypeTwitter];
[tweetSheet setInitialText:self.textForTweet];
[self presentViewController:tweetSheet animated:YES completion:nil];
} else [self displayAlertBoxWithTitle:@"Tweet Failed" message:@"Please try again later" cancelButton:@"Close"];
}
我应该改用模态对话框吗?
【问题讨论】:
-
从 ios8 开始不推荐使用操作表吗?
-
是的,UIActionSheets 已被弃用,但 SLComposeViewController 不是,这似乎是问题所在。
-
萨赫布,你可能是在正确的轨道上。在这里找到答案:stackoverflow.com/a/24854803/1422252
-
当我看到操作表时我就知道有些问题,直接呈现 SLVC 会产生好的结果,但在操作表上呈现它不会
标签: ios ipad modal-dialog presentviewcontroller