我正在使用UIPopoverController在iOS 6中呈现一个UITableViewController。
我正在努力使这个波波夫半透明,以便能够显示被遮掩的观点。除此之外,我希望有一个标准的弹出控制器与默认箭头等。
由于iOS 5,所以可以使用UIPopoverBackgroundView定义自定义的弹出背景视图。然而,我正在努力正确地设置背景。下面显示了用于设置背景视图的代码。我只想将设置为alpha值,并将其他属性设置为默认值。
此外,我还需要如何配置在中显示的表视图控制器,使其视图(以及除文本之外的所有子视图)也具有透明度。
谢谢!
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;
}发布于 2013-03-30 10:10:47
试试这个链接
设置
#define DEFAULT_TINT_COLOR [UIColor blackColor];
至
#define DEFAULT_TINT_COLOR [UIColor clearColor];https://stackoverflow.com/questions/15717147
复制相似问题