ios - Why can't add UIView to UITableViewCell directly but contentView -
i never think question before may stupid.
[cell.contentview addsubview:xxxview];
and
[cell addsubview:xxxview];
apple said contentview
should default superview contents. want know if bad if add subviews cell
directly.
apple document:
the content view of uitableviewcell object default superview content displayed cell. if want customize cells adding additional views, should add them content view positioned appropriately cell transitions , out of editing mode.
by default, editing control hidden until enter edit mode table in case, editing control appears (the minus button left of each row) , contentview gets resized , pushed right. gives "proper animation" effect.
to test difference, try adding subview such uilabel text, cell rather cell.contentview. when add cell rather cell.contentview , enter edit mode table, believe uilabel not resize, see edit button ontop/below minus sign button.
Comments
Post a Comment