I am using a UIPopoverController
to present a UITableViewController
in iOS 6.
I am trying to make this popover semi-transparent in order to be able to show the covered views. Other than that, I would like to have a standard popover controller with default arrows etc.
Since iOS 5 it is possible to define a custom popover background view using UIPopoverBackgroundView. However, I am struggling to set up the background correctly. The code I am using to set up the background view is shown below. I would like to set only the alpha value and keep other properties set to their default values.
In addition, how would I need to configure the table view controller presented inside the popover to give its view (and all its subviews, except the text) transparency too.
Thank you!
configPopover.popoverBackgroundViewClass = [TransparentPopoverBackGroundView class];
TransparentPopoverBackGroundView.m:
#import "TransparentPopoverBackGroundView.h"
@implementation TransparentPopoverBackGroundView
@synthesize arrowOffset;
@synthesize arrowDirection;
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.alpha = 0.4;
}
return self;
}
+ (UIEdgeInsets)contentViewInsets {
return UIEdgeInsetsMake(5, 5, 5, 5);
}
+ (CGFloat)arrowHeight{
return 10.0;
}
+ (CGFloat)arrowBase{
return 10.0;
}