Set background color on UITableView in IOS 6 [duplicate]

久未见 提交于 2019-12-03 02:14:16

You might need to add some code. Try -

[UITableView setBackgroundView: nil];

or you can also do :

UIView* bview = [[UIView alloc] init];
bview.backgroundColor = [UIColor yellowColor];
[tableView setBackgroundView:bview];

Both will work..

Did you try

addressNewTbl.backgroundView = nil;
[addressNewTbl setBackgroundColor:[UIColor redColor]];

You additionally need to disable the background view:

[addressNewTbl setBackgroundView:nil];

Instead of setting the background color of the entire UITableView, try what happens when you set its backgroundView's background color.

in cellForRowAtIndexPath datasource method.try setting

[cell setBackgroundColor:[UIcolor redColor]];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!