在没有设置header和footer的背景颜色的时候,直接设置content的背景色就可以。我的这个项目使用到了header并且设置了header的背景色,直接设置content的背景色,颜色有误,如图

headerView和contentView的背景色是一样的,但是显示却有色差。最后,发现是因为headerView/footerView设置了背景色的原因,把headerView的背景色设置为clearColor或者不设置,颜色就正常了,如图

在没有设置header和footer的背景颜色的时候,直接设置content的背景色就可以。我的这个项目使用到了header并且设置了header的背景色,直接设置content的背景色,颜色有误,如图
headerView和contentView的背景色是一样的,但是显示却有色差。最后,发现是因为headerView/footerView设置了背景色的原因,把headerView的背景色设置为clearColor或者不设置,颜色就正常了,如图
本文标题:Tableview设置cell的背景色
本文链接:https://www.haomeiwen.com/subject/lntzkftx.html
网友评论