我在代码中拥有什么:从UITableViewController继承的myVC: UITableViewController使用过xib,即.m中没有dataSource和tableviewDelegates,
tableView是已分组的,单元格具有白色
我在viewDidLoad中以以下方式设置了背景

 [self.tableView setBackgroundView:Nil];
    [self.tableView setBackgroundColor:[UIColor colorWithPatternImage: [UIImage imageNamed: @"App_Background"]]];

还尝试了backgroundView
 UIImageView *imgbg = [[UIImageView alloc]initWithFrame:self.tableView.frame];
    imgbg.image =  [UIImage imageNamed: @"App_Background"];
    [self.tableView setBackgroundView:imgbg];

问题:单元格的左右边缘具有不同的颜色问题图像

空白表格图片的是正确的,这就是的要求

表的必需的bg有点像这样也为tableCell尝试了clearcolor,即使蓝色浮动单元格bg不变

提前致谢

最佳答案

尝试这个:

UIView *background = [[UIView alloc] initWithFrame:self.tableView.frame];
background.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"App_Background.png"]];
self.tableView.backgroundView = background;

希望对您有所帮助!

关于iphone - tableview背景颜色不正确,单元格后面漂浮了错误的颜色,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17988150/

10-14 20:52
查看更多