我想要我的单元格上的矩形角。我实施了
cell.backgroundView = [[UIView alloc] initWithFrame:cell.bounds];
正如此评论中所建议的那样,但是当我点击单元格时,突出显示仍然是圆角......我怎样才能摆脱那些?
我想要我的单元格上的矩形角。我实施了
cell.backgroundView = [[UIView alloc] initWithFrame:cell.bounds];
正如此评论中所建议的那样,但是当我点击单元格时,突出显示仍然是圆角......我怎样才能摆脱那些?
cell.selectedBackgroundView = [[UIView alloc] initWithFrame:cell.bounds];
...并模仿亮点,你有
#import <QuartzCore/QuartzCore.h>
CAGradientLayer *gradient = [CAGradientLayer layer];
gradient.frame = cell.bounds;
gradient.colors = [NSArray arrayWithObjects:[[UIColor colorWithRed:0. green:0.545 blue:0.941 alpha:1] CGColor], [[UIColor colorWithRed:0.027 green:0.353 blue:0.878 alpha:1] CGColor], nil];
[cell.selectedBackgroundView.layer insertSublayer:gradient atIndex:0];
它并不完美 - 仍在检查为什么它在纵向上绘制单元格的右边界并且在我旋转设备时不横向缩放...
欢迎提出建议。