UIPopover ビューに似たカスタム UIView を構築しています。単に UIView クラスをサブクラス化し、内部にコントロールとイベントを構築します。このビューを表示するには、このように My sub Class データソースを介して 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 のようにスーパービューの AnyWhere をタップした場合、どうすればこのビューを閉じる(削除する)ことができますか?