简体   繁体   English

uitableviewcell中的背景视图和内容视图之间的区别

[英]Difference between background view and content view in uitableviewcell

Hi what is the difference between content view and background view in a uitableviewcell? 嗨,uitableviewcell中的内容视图和背景视图有什么区别?

As I have read in the apple docs I understand that the content view property is the superview for the content but what is the background view for? 正如我在Apple文档中所读到的,我理解content view属性是内容的超级视图,但是背景视图有什么用?

Thanks. 谢谢。

contentView:

The content view of a UITableViewCell object is the default superview for content displayed by the cell. UITableViewCell对象的内容视图是单元格显示的内容的默认超级视图。

backgroundView:

The default is nil for cells in plain-style tables (UITableViewStylePlain) and non-nil for grouped-style tables UITableViewStyleGrouped). 对于普通样式表(UITableViewStylePlain)中的单元,默认值为nil;对于分组样式表UITableViewStyleGrouped,默认值为nil。 UITableViewCell adds the background view as a subview behind all other views and uses its current frame location. UITableViewCell将背景视图添加为所有其他视图之后的子视图,并使用其当前框架位置。

Courtesy of the UITableViewCell Class Reference UITableViewCell类参考提供

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM