我使用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我只是想讓日視圖的形狀不是矩形,而是發現了這個問題。 –