Add UISwitch
to contentView
of cell.
The contentView
of a UITableViewCell
object is the default superview
for content displayed by the cell. If you want to customize cells by simply adding additional views, you should add them to the contentView
so they will be positioned appropriately as the cell transitions into and out of editing mode.
[[cell contentView] addSubview:switch];
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…