views:

488

answers:

3

Is it possible to present a popover without any sort of arrows pointing somewhere?

A: 

Nope, there is no UIPopoverArrowDirectionNone option, and UIPopoverArrowDirectionUnknown throws an exception i think if you try to use that to present.

Instead of a popover controller, you can call presentModalViewController:animated: and set the controller you are presenting to have a modal presentation style of UIModalPresentationFormSheet or perhaps UIModalPresentationPageSheet. Those are more traditional popup screens than popovers are.

Kevlar
Unfortunately, presentModalViewController is limited to certain particular frame sizes, while popovers are not, unless I'm missing something. They also don't provide the same look and feel as a popover.
David Liu
That's correct. Unfortunately, if your requirements are strict you may have to roll your own popups to get what you want.
Kevlar
+2  A: 

Yes it is possible just do:

 [self.popoverController presentPopoverFromBarButtonItem:anItem   
                                permittedArrowDirections:0
                                                animated:YES];

The zero represent no direction.

Matt
it works for me!!! thanks.. will apple accept this? ... by the way, is it posible to present a keyboard inside a popover, the way it looks on ipad passcode? http://stackoverflow.com/questions/3636560/how-to-present-keyboard-inside-popover-ipad-passcode-lock-style
Omer
A: 

Yes, it's possible. Use UIPopoverArrowDirectionUnknown option.

Ex.:

[popoverController presentPopoverFromRect:self.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUnknown animated:YES];
[popoverController presentPopoverFromBarButtonItem:aItem permittedArrowDirections:UIPopoverArrowDirectionUnknown animated:YES];
Marcos Issler
Doesn't the UIPopoverController specifically state that this direction should not be used?
David Liu