Reputation: 1646
Following is a snapshot of my popover:
I have an UIViewController
(say A) that I want to show as popoverController
. Also I want to customize popover so I am customizing the UIPopoverBackgroundView
(say 'b' - orange background). Everything is working right except that after rounding the corners of A.view and 'b' I have a rectangular shadow line (which from the snapshot probably belongs to A.view - green background). Based on UIView
or UIViewController
APIs, is there any way I can remove that shadow. I am only interested in removing the black line on left, top and right of the view not the fuzzy looking shadow.
I did try:
[A.view.layer setShadowOpacity:0.0];
but no luck.
Upvotes: 1
Views: 3456
Reputation: 271
Remove the call for [super layoutSubviews] in your layoutSubviews method.
Overriding wantsDefaultContentAppearance and returning NO did not work for me.
Upvotes: 3
Reputation: 119242
In your UIPopoverBackgroundView subclass, override the class method:
+ (BOOL)wantsDefaultContentAppearance
To return NO
. This prevents the drawing of the inner shadow as documented here.
Upvotes: 3
Reputation: 18477
You cannot control the shadow of a UIPopoverController
directly. Your options are:
UIPopoverBackgroundView
and provide your own graphics for the frame of the popover. Contrary to the official documentation, the shadow doesn't get drawn on for you when you subclass UIPopoverBackgroundView
. Here's a great post on how to do this: http://blog.andrewkolesnikov.com/custom-background-color-tint-for-uipopover-64835Upvotes: 2