我使用UITableView
制作日历视图(见下图),每个UITableViewCell
代表一个月有几个子视图,每个子视图代表有一天我们称它为DayView
,每DayView
包含子视图UILabel来显示月份的一天。到现在为止,一切似乎都很好,并且UITableView
的滚动顺利。但经过我在添加此行DayView
的- (instancetype)initWithFrame:(CGRect)frame
:iOS UITableView在设置子视图的layer.cornerRadius后不顺利滚动
self.layer.cornerRadius = 5.0;
的UITableView中的帧速率成为滚动时要低得多。它根本无法追上我的手指。那么最可能的原因是什么?
顺便说一句,我该怎么做才能解决这类问题?
谢谢。
编辑:
的cellForRowAtIndexPath
方法:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *monthCellIdentifier = @"MonthCell";
OPCalendarPageView *cell = [tableView dequeueReusableCellWithIdentifier:monthCellIdentifier];
cell.manager = _manager;
cell.date = [self dateForIndexPath:indexPath];
return cell;
}
而我使用的库JTCalendar,OPCalendarPageView
是JTCalendarPageView
一个定制版本,只是增加了一个月的第一天以上一个月的标签。
为什么你需要圆角每天看法? – rmaddy
请为以下代码添加-cellForRowAtIndexpath代码: – Johnykutty
@rmaddy我只是想让日视图的形状不是矩形,而是发现了这个问题。 –