ios7 UITableView高度,已更改,但返回默认值

ios7 UITableView高度,已更改,但返回默认值,ios,uitableview,autolayout,Ios,Uitableview,Autolayout,我是新来的。 我发现UITableview有一个奇怪的问题 加载uitableview时,高度为400。 然后,在程序中,我更改uitableview的高度 CGRect talkListFrame = _talkList.frame; talkListFrame.size.height = _talkListOriginalHeight -keyboardSize.height; [_talkList setFrame:talkListFrame]; 很好,我更改了uitableview(t

我是新来的。 我发现UITableview有一个奇怪的问题

加载uitableview时,高度为400。 然后,在程序中,我更改uitableview的高度

CGRect talkListFrame = _talkList.frame;
talkListFrame.size.height = _talkListOriginalHeight -keyboardSize.height;
[_talkList setFrame:talkListFrame];
很好,我更改了uitableview(talkList)的高度。 但是,当我将数据放入uitableview时,uitableview的高度返回到400。 ※我使用了一个自定义uitableviewcell,只需在单元格中添加一个标签

UILabel *lable = (UILabel*)[cell viewWithTag:6];
lable.text =@"xxxx";
如果我不使用自定义uitablecell,它很好,高度不会返回

cell.textLabel.text =@"";

为什么??自定义单元格是问题所在

当显示键盘时,请不要更改
。更改
contentInset

我是这样做的:

- (void)keyboardWillShow:(NSNotification *)notification{

    CGRect keyboardFrame = [[[notification userInfo]objectForKey:UIKeyboardFrameEndUserInfoKey]CGRectValue];

    [UIView animateWithDuration:0.3 delay:0.0 options: UIViewAnimationOptionCurveEaseOut | UIViewAnimationOptionBeginFromCurrentState animations:^{

        UIEdgeInsets tableViewInsets = UIEdgeInsetsMake(0, 0, keyboardFrame.size.height, 0);
        _talkList.scrollIndicatorInsets = tableViewInsets;
        _talkList.contentInset = tableViewInsets;

    }completion:nil];
}

- (void)keyboardWillHide:(NSNotification *)notification{

    [UIView animateWithDuration:0.3 delay:0.0 options: UIViewAnimationOptionCurveEaseOut | UIViewAnimationOptionBeginFromCurrentState animations:^{

        UIEdgeInsets tableViewInsets = UIEdgeInsetsZero;
        _talkList.scrollIndicatorInsets = tableViewInsets;
        _talkList.contentInset = tableViewInsets;

    }completion:nil];
}

看起来你在谈论桌子的行高。如果我是对的,请告诉我。。