Can I remove the arrow in the popover view?

后端 未结 7 1493
我寻月下人不归
我寻月下人不归 2021-02-09 12:13

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 ?<
相关标签:
7条回答
  • 2021-02-09 12:36

    For Swift

    popoverMenuViewController?.permittedArrowDirections = UIPopoverArrowDirection(rawValue:0) 
    
    0 讨论(0)
  • 2021-02-09 12:36

    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];
    
    0 讨论(0)
  • 2021-02-09 12:43

    popoverMenuViewController?.permittedArrowDirections = []

    0 讨论(0)
  • 2021-02-09 12:48

    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."

    0 讨论(0)
  • 2021-02-09 12:49

    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.

    0 讨论(0)
  • 2021-02-09 12:58
    myViewController.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirection(rawValue: 0)
    
    0 讨论(0)
提交回复
热议问题