2011-01-25 5 views
0

私はUIViewControllerのボタンから提示されるUIPopoverControllerを持っていますが、ポップオーバーではないビューの任意の部分をタップすると隠れていませんか?UIBopから提示されたUIPopoverControllerが非表示になっていませんか?

このポップオーバーを提示ボタンが動的に作成され、あなたは以下のコードで参照することを確認できます:

-(IBAction)showModifiers:(id)sender{ 

    [self.popoverController dismissPopoverAnimated:YES]; 

    UIView *theSuperview = self.view; 
    CGPoint touchPointInSuperview = [sender locationInView:theSuperview]; 
    UIView *touchedView = [theSuperview hitTest:touchPointInSuperview withEvent:nil]; 

    currentPopoverTag = [touchedView tag]; 
    NSLog(@"Show Modifiers %i %i", [touchedView tag], currentPopoverTag); 

    RepZioCoreDataAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate]; 
    if (appDelegate.popoverController) 
     [appDelegate.popoverController dismissPopoverAnimated:YES]; 

    self.modifierListPopoverViewController = nil; 
    ModifierListCollection *collection = [self.modifierLists objectAtIndex:[touchedView tag]-100]; 
    ModifierList *modifierList = [self getModifierList:collection.ModifierListID]; 
    self.modifierListPopoverViewController = 
    [[[ModifierListPopoverViewController alloc] initWithModifierList:modifierList withManufacturerID: self.manufacturerID] autorelease]; 
    self.modifierListPopoverViewController.delegate = self; 

    self.popoverController = [[[UIPopoverController alloc] initWithContentViewController:modifierListPopoverViewController] autorelease]; 
    [self.popoverController presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; 
} 

答えて

0

いくつかのビューがタッチイベントに取り組んでいるようです。

1

ModifierListPopoverViewControllerクラスはmodalInPopoverプロパティをYESに設定していますか? (デフォルトはNOで、これはあなたが探している動作を与えるはずです)。

関連する問題