TableView 单元格颜色

发布于 2024-09-15 06:43:38 字数 734 浏览 9 评论 0原文

我现在遇到了个问题,如何使uitableview cell 的背景色填满整个cell ,以下是我的代码。但它不能正常工作、、、

图片显示:

http://www.flickr.com/photos/53054715@N05/4898445104/

如何编写在单元格视图中设置颜色填充的代码?

我的代码如下,但效果不佳。

cell.contentView.backgroundColor =[UIColor groupTableViewBackgroundColor];
cell.backgroundColor=[UIColor groupTableViewBackgroundColor];
cell.backgroundView.backgroundColor =[UIColor groupTableViewBackgroundColor];
cell.textLabel.backgroundColor = [UIColor groupTableViewBackgroundColor];
cell.detailTextLabel.backgroundColor = [UIColor groupTableViewBackgroundColor];
我现在遇到了个问题,如何使uitableview cell 的背景色填满整个cell ,以下是我的代码。但它不能正常工作、、、

Picture shows:

http://www.flickr.com/photos/53054715@N05/4898445104/

How can I code that set the color fill in cell view?

My code is below, but it does not work well.

cell.contentView.backgroundColor =[UIColor groupTableViewBackgroundColor];
cell.backgroundColor=[UIColor groupTableViewBackgroundColor];
cell.backgroundView.backgroundColor =[UIColor groupTableViewBackgroundColor];
cell.textLabel.backgroundColor = [UIColor groupTableViewBackgroundColor];
cell.detailTextLabel.backgroundColor = [UIColor groupTableViewBackgroundColor];

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时间你老了 2024-09-22 06:43:38

有用!

  • (NSInteger)TableView 中的节数:(UITableView *)tableView
    {
    [tableView setBackgroundColor:[UIColor groupTableViewBackgroundColor]];
    返回1;
    }

it works!

  • (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
    {
    [tableView setBackgroundColor:[UIColor groupTableViewBackgroundColor]];
    return 1;
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文