0

当用户从表中选择第一行时出现弹出框?

当用户从弹出窗口中选择任何行时,应将单元格添加到相应的表中,即显示弹出窗口的表?我怎样才能做到这一点?

third = nil;
self.colorPickerPopover = nil;
UITableViewCell *cell= [tableView cellForRowAtIndexPath:indexPath];
CGRect rect=CGRectMake(cell.bounds.origin.x+300, cell.bounds.origin.y+10, 10, 10);
if (indexPath.section ==0) {
    if (indexPath.row == 0 ) {
        if (third == nil) {
            third  = [[ThirdViewController alloc] initWithStyle:UITableViewStylePlain];
            UINavigationController *controller = [[UINavigationController alloc] initWithRootViewController:third];
            self.colorPickerPopover = [[UIPopoverController alloc] initWithContentViewController:controller] ;
            [colorPickerPopover setDelegate:self];
            [self.colorPickerPopover presentPopoverFromRect:rect inView:cell permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
            UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStylePlain target:self action:@selector(cancelClicked)];
            [[UINavigationBar appearance] setTintColor:[UIColor darkGrayColor]];
            third.navigationItem.leftBarButtonItem = closeButton;
            UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStylePlain target:self action:@selector(doneClicked)];
            [[UINavigationBar appearance] setTintColor:[UIColor darkGrayColor]];
            third.navigationItem.rightBarButtonItem = doneButton;
        }
4

1 回答 1

0

好的,当您的弹出框在那时消失时,可以像这样尝试使用新的元素数组重新加载您的表格视图。

EDIT:

获取一个用于在 tableview 上显示数据的数组,并且每当您当时关闭弹出概览时,将所选元素添加到该 tableview 数组中,然后使用新的 tableview 数组重新加载您的 tableview。

于 2013-04-19T10:57:55.363 回答