0

ポップオーバーに関する簡単な質問です。ポップビューから何かを選択したときにポップビューを閉じる方法を把握していないようです(テーブルビュー)

だから私は UIPopoverController を使用してポップアップするテーブルビューにリスト項目を持っているので、アイテムを選択すると、ポップオフしてフェードアウトしたいと思います。

MainViewController

  - (IBAction)popoverFontName:(id)sender 
    CGRect popoverRect = [self.view convertRect:[popoverFontName frame] 
                                       fromView:[popoverFontName superview]];
    TitleController *titleC=[[TitleController alloc]init];
    popup =[[UIPopoverController alloc]initWithContentViewController:titleC];

    [popup presentPopoverFromRect:popoverRect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    [popup setPopoverContentSize:CGSizeMake(50.0, 300.0)];

    [titleC release];

}

タイトルコントローラー

- (void)tableView:(UITableView *)tableView 
didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    NSString *selectedLang = [titleList objectAtIndex:indexPath.row];  

    //Initialize the detail view controller and display it.  
    MyDetViewCont *myDetViewCont = [[MyDetViewCont alloc] initWithNibName:@"myDetViewCont" bundle:[NSBundle mainBundle]]; // view controller instance  

}

タイトルコントローラーで、ポップオーバーを閉じる方法がわかりません

4

1 に答える 1

0

popoverController で、dismissPopoverAnimated: を呼び出すことができます。UITableViewDelegate メソッドから閉じるには、ポップオーバーのインスタンスをインスタンス変数として保持する必要があります。

于 2011-01-28T19:57:24.317 に答える