Basically these are two questions:
How to remove iPad's popover view's arrow?
is there any way to remove popover's black border?
If not possible, can you suggest a way in iPad to display an UIView (popover) at the top of screen without arrow and border (might be light transparent border), please? thanks a lot.
And I don't think ModalView is a proper option, as it cannot be resized and cannot be dismissed by clicking outside modal view.
AFIK there is no built-in way to specify "no arrow", or to have a popup sans borders.
This a hack, but it basically works. In the context of your view controller that is managed by the popup controller, during viewWillAppear:, get the popup window and remove the first layer, which is what renders the arrow and border:
- (void) viewWillAppear: (BOOL) animated
{
[super viewWillAppear: animated];
UIView* v = self.view.superview;
NSLog( @"%@", NSStringFromClass( [v class]) ); // this should print UIView
v = v.superview;
NSLog( @"%@", NSStringFromClass( [v class]) ); // this should print UIPopoverView
[[v.layer.sublayers objectAtIndex:0] removeFromSuperlayer];
}
I suppose you could experiment with adding back your own layer that rendered the background/border the way you wanted to.
How to remove iPad's popover view's arrow?
When calling -presentPopoverFromBarButtonItem:permittedArrowDirections:, pass 0 as the second parameter, rather than any of the constants. This isn't documented, but Apple is allowing apps in the App Store when using this setting.
You cannot remove the chrome around the popover. Your best bet is to reimplement the idea of a popover, but using custom code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With