我正在使用UIToolbar和preferred style为action sheet的UIAlertController向用户展示选项列表。当弹出时,气泡箭头被切断,并且其角落有两个不同的半径:
我使用的代码直接来自文档,据我所见:
UIAlertController *alertController =
[UIAlertController alertControllerWithTitle:@""
message:@""
preferredStyle:UIAlertControllerStyleActionSheet];
NSArray *actions = @[
[UIAlertAction actionWithTitle:@"Take a Photo"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {}],
[UIAlertAction actionWithTitle:@"Choose from Album"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {}],
[UIAlertAction actionWithTitle:@"Cancel"
style:UIAlertActionStyleCancel
handler:^(UIAlertAction *action) {}]
];
for (UIAlertAction *action in actions) {
[alertController addAction:action];
}
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
alertController.modalPresentationStyle = UIModalPresentationPopover;
alertController.popoverPresentationController.barButtonItem = myBarButtonItem;
}
[self presentViewController:alertController animated:YES completion:nil];
这是一个已知的 bug 吗?我已经尝试了运行在 iOS 8.2 上的 iPad 和模拟器,还有运行在 iOS 8.1 和 8.2 上的模拟器。
@""
替换为nil
会发生什么? - Duck