thndrkiss
thndrkiss

Reputation: 4595

Can I remove the arrow in the popover view?

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 ?

Upvotes: 10

Views: 14622

Answers (7)

Igor Palaguta
Igor Palaguta

Reputation: 3579

popoverMenuViewController?.permittedArrowDirections = []

Upvotes: 0

Douglas Mendes
Douglas Mendes

Reputation: 36

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.

Upvotes: 1

Abhishek Jain
Abhishek Jain

Reputation: 4737

myViewController.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirection(rawValue: 0)

Upvotes: 1

Phil
Phil

Reputation: 1117

For Swift

popoverMenuViewController?.permittedArrowDirections = UIPopoverArrowDirection(rawValue:0) 

Upvotes: 23

ascentury
ascentury

Reputation: 196

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

Upvotes: 3

RunningPink
RunningPink

Reputation: 218

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];

Upvotes: 10

zoul
zoul

Reputation: 104145

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.

Upvotes: 1

Related Questions