uitableviewcell中的背景视图和内容视图之间的区别 [英] Difference between background view and content view in uitableviewcell

查看:75
本文介绍了uitableviewcell中的背景视图和内容视图之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在uitableviewcell中内容视图和背景视图有什么区别?

Hi what is the difference between content view and background view in a uitableviewcell?

正如我在Apple文档中所读到的,我理解content view属性是内容的超级视图,但是背景视图有什么用?

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?

谢谢.

推荐答案

contentView:

UITableViewCell对象的内容视图是单元格显示的内容的默认超级视图.

The content view of a UITableViewCell object is the default superview for content displayed by the cell.

backgroundView:

对于普通样式表(UITableViewStylePlain)中的单元,默认值为nil;对于分组样式表UITableViewStyleGrouped,默认值为nil. UITableViewCell将背景视图作为子视图添加到所有其他视图之后,并使用其当前框架位置.

The default is nil for cells in plain-style tables (UITableViewStylePlain) and non-nil for grouped-style tables UITableViewStyleGrouped). UITableViewCell adds the background view as a subview behind all other views and uses its current frame location.

UITableViewCell类参考

这篇关于uitableviewcell中的背景视图和内容视图之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆