UITableViewHeaderFooterView: Unable to change background color

前端 未结 20 2255
误落风尘
误落风尘 2020-12-23 08:38

I\'m trying to change the background color of UITableViewHeaderFooterView. Although the view is appearing, the background color remains the default color. I\'m getting a log

20条回答
  •  鱼传尺愫
    2020-12-23 09:13

    if you created a custom subclass of UITableViewHeaderFooterView with xib file then you should override setBackgroundColor. Keep it empty.

    -(void)setBackgroundColor:(UIColor *)backgroundColor {
    
    }
    

    And this will solve your problem.

提交回复
热议问题