美文网首页
ios app审核时遇到ipad不能调用 UIAlertCont

ios app审核时遇到ipad不能调用 UIAlertCont

作者: 念念不忘一个丫头的容 | 来源:发表于2017-03-17 16:20 被阅读0次

遵循代理协议UIPopoverPresentationControllerDelegate

添加代码 :(button  是点击的控件)

```

- (void)userYourHandsButtonAction:(UIButton *)button{

//初始化提示框

UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];

UIPopoverPresentationController *popover = alert.popoverPresentationController;

if (popover) {

popover.sourceView = button;

popover.sourceRect = button.bounds;

popover.permittedArrowDirections = UIPopoverArrowDirectionAny;

}

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

}

```

相关文章

网友评论

      本文标题:ios app审核时遇到ipad不能调用 UIAlertCont

      本文链接:https://www.haomeiwen.com/subject/tfgenttx.html