トラッキング コード

9/07/2019

[Swift] Do not work backgound color of UITableViewHeaderFooterView

UITableViewHeaderFooterView can not set backgound color


We can not set the backgound color on UITableViewHeaderFooterView.
If set, we see the following log.

"Setting the background color on UITableViewHeaderFooterView has been deprecated. Please use contentView.backgroundColor instead."


if change backgroundColor, use the "contentView" that is included in UITableViewHeaderFooterView.
    sectionHeader?.contentView.backgroundColor = backgroundColor