【问题标题】:is there a way to not show the rounded corner for the top and bottom cell of each section in grouped UITableView?有没有办法不显示分组 UITableView 中每个部分的顶部和底部单元格的圆角?
【发布时间】:2012-04-15 22:28:22
【问题描述】:

我想将它们改为直矩形,并在每个部分的四个边上添加一个投影。

有没有办法做到这一点?我在每个单元格上尝试了以下操作,但它似乎不适用于我。

[cell.layer setCornerRadius:0.0f];
[cell.layer setBorderColor:[UIColor clearColor].CGColor];
[cell.layer setBorderWidth:1.0f];
[cell.layer setShadowColor:[UIColor blackColor].CGColor];
[cell.layer setShadowOpacity:0.4f];
[cell.layer setShadowRadius:0.8f];
[cell.layer setShadowOffset:CGSizeMake(0.8f, 0.8f)];

我的代码有什么问题吗?

【问题讨论】:

    标签: iphone uitableview dropshadow cornerradius


    【解决方案1】:

    添加另外两行,一在顶部,一在底部。实现 heightForCellAtIndexPath: 并为这些单元格返回 0 高度。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多