我可以删除弹出视图中的箭头吗?

发布于 2024-10-14 18:09:45 字数 113 浏览 8 评论 0原文

我被要求删除弹出视图的箭头。

  1. 这是否违反了人机界面准则?
  2. 在另一个弹出窗口中显示一个弹出窗口是否明智?
  3. 如果不违反人机界面准则怎么办?

I am asked to removed the arrow of the popover view.

  1. Is that violating human interface guidelines ?
  2. Is it wise to show a popover inside another popover ?
  3. If it is not violating human interface guidelines how to do that ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

小情绪 2024-10-21 18:09:46

对于斯威夫特

popoverMenuViewController?.permittedArrowDirections = UIPopoverArrowDirection(rawValue:0) 

For Swift

popoverMenuViewController?.permittedArrowDirections = UIPopoverArrowDirection(rawValue:0) 
幸福丶如此 2024-10-21 18:09:46

当然,有很多人对此有要求,特别是当弹出窗口足够大并且箭头指向的点会被遮挡时。

没有任何可用性缺点。

[pop presentPopoverFromBarButtonItem:_toolbarBtnImage2
permittedArrowDirections:0 // <- pass in zero for no arrows
animated:YES];

Sure thing, and there is plenty of call for this, specifically when the popover is large enough and the point at where the arrow would point would be obscured.

There's no usability drawback whatsoever.

[pop presentPopoverFromBarButtonItem:_toolbarBtnImage2
permittedArrowDirections:0 // <- pass in zero for no arrows
animated:YES];

2012-03-07 人机界面指南,第 14 页隐式禁止省略或删除箭头。 114:“弹出窗口......始终显示一个箭头,指示它出现的位置。”

The omission or removal of the arrow is implicitly banned by the 2012-03-07 Human Interface Guidelines, p. 114: "A popover ... always displays an arrow that indicates the point from which it emerged."

遇到 2024-10-21 18:09:46

隐藏弹出窗口箭头或将一个弹出窗口显示在另一个弹出窗口中听起来不太明智。我不确定 HIG 是否明确禁止这样做,但无论如何这都是一个可用性缺陷。如果您坚持,您可以绘制自己的无箭头弹出框,或者尝试使用在其顶部组成的某些视图来掩盖箭头。我认为重新考虑用户界面会更好。

Hiding the popover arrow or showing one popover inside another does not sound very wise. I’m not sure if this is explicitly forbidden by the HIG, but it’s a usability drawback anyway. If you insisted you could draw your own arrowless popover or try to mask the arrow using some view composed on the top of it. I think it would be much better to rethink the UI.

浮生未歇 2024-10-21 18:09:46
myViewController.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirection(rawValue: 0)
myViewController.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirection(rawValue: 0)
二智少女 2024-10-21 18:09:46

只需添加一些糖和 Swifty 代码:

扩展:

extension UIPopoverArrowDirection {
    static var none: UIPopoverArrowDirection { UIPopoverArrowDirection(rawValue: 0) }
}

用法:

popoverMenuViewController?.permittedArrowDirections = .none

您可以更改变量的名称以满足您的需要。

Just to add some sugar and Swifty the code :

Extension:

extension UIPopoverArrowDirection {
    static var none: UIPopoverArrowDirection { UIPopoverArrowDirection(rawValue: 0) }
}

Usage:

popoverMenuViewController?.permittedArrowDirections = .none

you can change the variable's name to fits your needs.

夏末染殇 2024-10-21 18:09:46

popoverMenuViewController?.permissedArrowDirections = []

popoverMenuViewController?.permittedArrowDirections = []

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文