Ios 全屏设置UITableViewCell

Ios 全屏设置UITableViewCell,ios,iphone,uitableview,Ios,Iphone,Uitableview,当用户选择带有反弹动画的单元格时,我想全屏设置UITableViewCell。我分享了下面的链接。我想要像这样的 我在牢房里设置了视图。但是我不能用动画全屏显示 下面是我的代码: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableViewList cellForRowAtIndexPa

当用户选择带有反弹动画的单元格时,我想全屏设置
UITableViewCell
。我分享了下面的链接。我想要像这样的

我在牢房里设置了视图。但是我不能用动画全屏显示

下面是我的代码:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{   
    UITableViewCell *cell = [tableViewList cellForRowAtIndexPath:indexPath];
    int index = [cell.accessibilityIdentifier intValue];
    CGFloat delay = 0.0f;
    if (indexSelected == (int)indexPath.row)
    {
        //COLLAPSE
        indexSelected = -1111111111;
        UIView *viewController = (UIView *)[cell.contentView viewWithTag:TAG_DETAIL_CONTROLLER];
        [viewController removeFromSuperview];

        tableViewList.frame = frameTableViewList;
        [tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
        btnBack.hidden = YES;
        indexSelected = -1;
    }
    else
    {
        //EXPAND
        if (indexSelected < 0)
            indexSelected = index;
        else
        {
            int indexPrevious = indexSelected;
            indexSelected = (int)indexPath.row;
            [tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:indexPrevious inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
            delay = 0.3;
        }

        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];


            CGRect frame = tableViewList.frame;
            frame.origin.y = 0;
            frame.size.height = CGRectGetHeight(self.view.frame);
            tableViewList.frame = frame;
            btnBack.hidden = NO;
        });
    }
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];

    if (cell == nil)
            cell = [self reuseTableViewCellWithIdentifier:cellIdentifier];

    cell.selectionStyle = UITableViewCellSelectionStyleNone;

    UIView *viewController = (UIView *)[cell.contentView viewWithTag:TAG_DETAIL_CONTROLLER];
    if (indexSelected >= 0 && indexSelected == (int)indexPath.row)
        [self addDiamondDetailView:cell index:(int)indexPath.row];
    else
    {
        if (indexSelected == -1111111111)
        {
            CGRect frame = cell.frame;
            frame.size.height = cellHeight;
            cell.frame = frame;
            cell.contentView.frame = CGRectMake(0, 0, CGRectGetWidth(cell.frame), CGRectGetHeight(cell.frame));
        }

        [viewController removeFromSuperview];
    }

    cell.contentView.clipsToBounds = YES;
    return cell;
}

- (void)addDiamondDetailView:(UITableViewCell *)cell index:(int)index
{
    DetailVC = [[DetailViewController  alloc] initWithNibName:@"DetailViewController" bundle:nil];
DetailVC.selectedStoneInfo = (StoneInfo *)[arrStone objectAtIndex:index];
    DetailVC._STONE_DETAIL_TYPE = self._RESULT_PAGE_TYPE == RESULT_MY_CART ? STONE_DETAIL_CART : STONE_DETAIL_RESULT;
DetailVC.delegate = self;
DetailVC.view.tag = TAG_DETAIL_CONTROLLER;
    [cell.contentView addSubview:stoneDetailVC.view];

    //Cell Frame
    CGRect frame = cell.bounds;
    frame.size.height = cellDetailHeight;
    cell.frame = frame;
    cell.contentView.frame = CGRectMake(0, 0, CGRectGetWidth(cell.frame), CGRectGetHeight(cell.frame));

    //Stone Detail VC  Frame
    frame = stoneDetailVC.view.frame;
DetailVC.view.frame = CGRectMake(0, 0, CGRectGetWidth(stoneDetailVC.view.frame), cellDetailHeight);
}
-(void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(nsindepath*)indepath
{   
UITableViewCell*单元格=[tableViewList cellForRowAtIndexPath:indexPath];
int index=[cell.accessibilityIdentifier intValue];
CGFloat延迟=0.0f;
if(indexSelected==(int)indexPath.row)
{
//崩溃
指数selected=-1111;
UIView*viewController=(UIView*)[cell.contentView视图带标记:标记\详细信息\控制器];
[viewController从SuperView移除];
tableViewList.frame=frameTableViewList;
[tableView重新加载RowsatindExpaths:@[indexPath]和RowAnimation:UITableViewRowAnimationNone];
btnBack.hidden=是;
指数selected=-1;
}
其他的
{
//扩展
如果(指数选择<0)
indexSelected=指数;
其他的
{
int indexPrevious=indexSelected;
indexSelected=(int)indexPath.row;
[tableView重新加载RowSatindExpaths:@[[NSIndexPath indexPathForRow:IndeExplorous inSection:0]]带RowAnimation:UITableViewRowAnimationNone];
延迟=0.3;
}
在(调度时间(现在调度时间,(int64_t)(延迟*NSEC_/u秒))之后调度,调度获取主队列()^{
[tableView重新加载RowsatindExpaths:@[indexPath]和RowAnimation:UITableViewRowAnimationNone];
CGRect frame=tableViewList.frame;
frame.origin.y=0;
frame.size.height=CGRectGetHeight(self.view.frame);
tableViewList.frame=框架;
btnBack.hidden=否;
});
}
}
-(UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{
静态NSString*cellIdentifier=@“Cell”;
UITableViewCell*单元格=[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
如果(单元格==nil)
cell=[self-reuseTableViewCellWithIdentifier:cellIdentifier];
cell.selectionStyle=UITableViewCellSelectionStyleNone;
UIView*viewController=(UIView*)[cell.contentView视图带标记:标记\详细信息\控制器];
if(indexSelected>=0&&indexSelected==(int)indexPath.row)
[self addDiamondDetailView:cell索引:(int)indexPath.row];
其他的
{
如果(indexSelected==-1111)
{
CGRect frame=cell.frame;
frame.size.height=单元高度;
cell.frame=frame;
cell.contentView.frame=CGRectMake(0,0,CGRectGetWidth(cell.frame),CGRectGetHeight(cell.frame));
}
[viewController从SuperView移除];
}
cell.contentView.clipstobunds=是;
返回单元;
}
-(void)addDiamondDetailView:(UITableViewCell*)单元格索引:(int)索引
{
DetailVC=[[DetailViewController alloc]initWithNibName:@“DetailViewController”捆绑包:nil];
DetailVC.selectedStoneInfo=(StoneInfo*)[arrStone objectAtIndex:index];
DetailVC.\u STONE\u DETAIL\u TYPE=self.\u RESULT\u PAGE\u TYPE==RESULT\u MY\u CART?STONE\u DETAIL\u CART:STONE\u DETAIL\u RESULT;
DetailVC.delegate=self;
DetailVC.view.tag=tag\u DETAIL\u控制器;
[cell.contentView addSubview:stoneDetailVC.view];
//细胞框架
CGRect frame=cell.bounds;
frame.size.height=cellDetailHeight;
cell.frame=frame;
cell.contentView.frame=CGRectMake(0,0,CGRectGetWidth(cell.frame),CGRectGetHeight(cell.frame));
//石材细部VC框架
frame=stoneDetailVC.view.frame;
DetailVC.view.frame=CGRectMake(0,0,CGRectGetWidth(stoneDetailVC.view.frame),cellDetailHeight);
}

我已将
ViewController
作为子视图添加到单元格中。我想用反弹动画在全屏视图中设置表格单元格。请帮助我。

您可能正在寻找的是视图控制器转换。如果用户单击任何单元格,它将全屏展开。我的视图控制器将作为“单元格内容”视图中的子视图添加。您最好转换为带有动画的全屏视图控制器,这样看起来您正在扩展单元格,但你真的不是。如何做到这一点?我不知道。有什么解决办法吗?如果你解决了这个问题,你能用这个办法回答你自己的问题吗?我相信它会对其他人(比如我(!)有用)。您可能正在寻找的是视图控制器转换。如果用户单击任何单元格,它将全屏展开。我的视图控制器将作为“单元格内容”视图中的子视图添加。您最好使用动画转换为全屏视图控制器,这样看起来您正在扩展单元格,但你真的不是。如何做到这一点?我不知道。有什么解决办法吗?如果你解决了这个问题,你能用这个办法回答你自己的问题吗?我相信它会对其他人(比如我)有用。