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

2017-03-17  本文已影响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];

}

```

上一篇 下一篇

猜你喜欢

热点阅读