【发布时间】:2012-04-30 14:54:43
【问题描述】:
我正在构建一个类似于 UIPopover 视图的自定义 UIView,我只是将 UIView 类子类化并在里面构建控件和事件的东西.. 为了显示这个视图,我通过这样的子类数据源分配 superView
if ([dataSource respondsToSelector:@selector(containerView)])
superView = [dataSource containerView];
为了展示它,我有一个这样的函数
- (void) showPopOverFromRect : (CGRect) rect
{
CGSize popSize = self.frame.size;
float yPoint;
if(ntPopOverDirection == NTPopOverArrowDirectionUP)
yPoint = rect.origin.y + 10;
else
yPoint = rect.origin.y - 10;
self.frame = CGRectMake(rect.origin.x - popSize.width, yPoint , popSize.width, popSize.height);
[superView addSubview:self];
}
所以我的问题..如果用户像 UIPopOverController 一样点击 superView 上的 AnyWhere ,我怎么能关闭这个视图(删除它)?
【问题讨论】:
标签: ios uiview uipopovercontroller