UITableViewCell的层级结构

UITableViewCell中的contentView、backgroundView、selectedBackgroundView、multipleSelectionBackgroundView

UITableViewCell 层级结构

  1. UITableViewCell
 Default is nil for cells in UITableViewStylePlain, and non-nil for UITableViewStyleGrouped. 
 The 'backgroundView' will be added as a subview behind all other views.
复制代码
  1. backgroundView
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.
复制代码
  1. selectedBackgroundView (multipleSelectionBackgroundView)]
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.
复制代码
  1. contentView
selectedBackgroundView只有在用户点击cell的时候才会被cell当作子类加入,层级在backgroundView(如果它存在)之上,其他所有控件之下。

multipleSelectionBackgroundView的层级是在contentView之下,selectedBackgroundView之上。

复制代码

相关文章

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值