iphone - 表格单元格颜色不适用于披露指示器后面

发布于 2024-08-02 01:59:57 字数 124 浏览 5 评论 0原文

我有一个表格视图,它具有替代颜色作为单元格的背景颜色。 除此之外,我还添加了一个披露指示器配件。 然而,问题是单元格背景颜色似乎不适用于披露指示器“后面”的区域。 在公开指示符出现在表格单元格右端之前,单元格背景颜色似乎被截断。

I have a table view that has alternate colors as background color for cells.
In addition to that i have added a disclosure indicator accessory.
However, the problem is that the cell background color doesnt seem to apply to the area 'behind' the disclosure indicator. The cell background color seems to truncate before the disclosure indicator appears at the right end of the table cell.

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

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

发布评论

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

评论(1

小ぇ时光︴ 2024-08-09 01:59:57

我有类似的问题。 发生这种情况似乎是因为表中的每一行都分为几个部分。 因此,仅更改 cell.BackgroundColor 不会更改整个行的颜色。

尝试类似的东西..它对我有用:

UITableViewCell *bgView = [[UITableViewCell alloc] initWithFrame:CGRectZero];
    bgView.backgroundColor=indexPath.row % 2? [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:1]: [UIColor whiteColor];
    cell.backgroundView=bgView;

I had a similar problem. This seems to happen because each row in a table is divided into several parts. So merely changing cell.BackgroundColor isn't going to change the entire rows color.

Try something similar to this.. It worked for me:

UITableViewCell *bgView = [[UITableViewCell alloc] initWithFrame:CGRectZero];
    bgView.backgroundColor=indexPath.row % 2? [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:1]: [UIColor whiteColor];
    cell.backgroundView=bgView;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文