UITableViewCell 层级结构bash
Default is nil for cells in UITableViewStylePlain, and non-nil for UITableViewStyleGrouped.
The 'backgroundView' will be added as a subview behind all other views.
复制代码
Default is nil for cells in UITableViewStylePlain, and non-nil for UITableViewStyleGrouped.
The 'selectedBackgroundView' will be added as a subview directly above the backgroundView if not nil, or behind all other views.
It is added as a subview only when the cell is selected.
Calling -setSelected:animated: will cause the 'selectedBackgroundView' to animate in and out with an alpha fade.
复制代码
If you want to customize cells by simply adding additional views,
you should add them to the content view so they will be positioned appropriately as the cell transitions into and out of editing mode.
复制代码
selectedBackgroundView只有在用户点击cell的时候才会被cell看成子类加入,层级在backgroundView(若是它存在)之上,其余全部控件之下。
multipleSelectionBackgroundView的层级是在contentView之下,selectedBackgroundView之上。
复制代码
相关文章app