一般来说,高度UITableViewCell
只能通过 设置tableview:heightForRowAtIndexPath:
,而后一种方法在 之前只能调用一次(每行每节)tableView:cellForRowAtIndexPath:
,因此[tableview reloadData]
如果要调整 UITableViewCell 高度,则必须进行调整。
也许你可以在这些委托方法中做点什么
// The willBegin/didEnd methods are called whenever the 'editing' property is automatically changed by the table (allowing insert/delete/move). This is done by a swipe activating a single row
- (void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath;
- (void)tableView:(UITableView*)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath;
- (void)layoutSubviews
对于您的问题,您可以在自定义 UITableViewCell 中重置文本控件的属性。
- (void)layoutSubviews
{
[super layoutSubviews];
CGFloat theWidth = self.frame.size.height; //changed when entering the edit style
...
}
希望这些对您有所帮助。