cell.backgroundView = [[UIView alloc] initWithFrame:cell.bounds];
正如this comment中所建议的那样,但是当我点击单元格时,突出显示仍有圆角...我怎样才能摆脱那些?
答案 0 :(得分:2)
cell.selectedBackgroundView = [[UIView alloc] initWithFrame:cell.bounds];
答案 1 :(得分:0)
...并模仿亮点,你有
#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];
它并不完美 - 仍在检查为什么它在纵向上划过单元格的右边界,而在旋转设备时不会在横向上缩放......
建议欢迎。