开发者

unused cells background color

开发者 https://www.devze.com 2022-12-22 17:03 出处:网络
I have a UITableView which displays about 5 开发者_开发问答cells at a time, yet in my table there might be cases where there are only 2 cells with content as seen on this picture:

I have a UITableView which displays about 5 开发者_开发问答cells at a time, yet in my table there might be cases where there are only 2 cells with content as seen on this picture:

alt text http://www.freeimagehosting.net/uploads/30d3602979.png

The white cells below do not look nice, how can I change the background color of these cells to black too? UITableView does not have a backgroundColor property.

Thanks!


A UITableView inherits from UIView, and UIView always has a backgroundColor.

You can also change the background color to "non-opaque", and then change the background color of your parent container.

tableView.backgroundColor = // some UIColor
0

精彩评论

暂无评论...
验证码 换一张
取 消