问题描述:

I have a UITableViewCell. How should I add a subview to it? I have seen many example to add subview to the contentView, but why not directly to the cell?

网友答案:

You can do it, but If you want to customize cells by adding custom view, you should add them to the contentView in order to get them animated along the table animations

网友答案:

When you add a custom view to contentView or assigning to contentView handles framing resizing part ,animation part and when editing mode is ON (tableView.editing = YES;) tableview tries to operate with views of itself meaning contentView, accessoryView. So when you want to add something to the table view and let control be given to tableView go for contentView

相关阅读:
Top