如何解决Xamarin.iOS:UIAlertController 不会禁用其他 UIBarButtonItem
我正在尝试在 UINavigationItem 中显示带有 UIBarButtonItem 的菜单 (UIAlertController)。
但如果我这样做:
if (alertMenu.PopoverPresentationController != null)
{
alertMenu.PopoverPresentationController.BarButtonItem = overflowButton;
alertMenu.PopoverPresentationController.PermittedArrowDirections = UIPopoverArrowDirection.Up;
}
UINavigationItem 中的其他 UIBarButtonItems 仍然可以点击而不关闭 Menu。但我希望按钮不可点击。
所以我是这样试的:
if (alertMenu.PopoverPresentationController != null)
{
alertMenu.PopoverPresentationController.SourceView = overflowButton.ValueForKey(new NSString("view")) as UIView;
alertMenu.PopoverPresentationController.PermittedArrowDirections = UIPopoverArrowDirection.Up;
}
哪个有效,但有没有办法像第一种方法那样做,因为它看起来更干净。或者这不可能吗?这是错误还是功能?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。