tại sao thiết lập màu của UITableViewCell
làm việc trong willDisplayCell
nhưng không ở trong cellForRowAtIndexPath
?tại sao thiết lập công việc màu của UITableViewCell trong "willDisplayCell" nhưng không có trong "cellForRowAtIndexPath"?
Ghi chú:
- Tôi đang sử dụng mã này để thiết lập màu nền của một tế bào:
[cell setBackgroundColor:[UIColor yellowColor]];
- công trình khi tôi đặt nó trong phương pháp
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
- không làm việc nếu tôi đặt trong trong
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
Bạn có thể đăng triển khai của mình 'tableView: willDisplayCell: forRowAtIndexPath:' và 'tableView: cellForRowAtIndexPath:'? – titaniumdecoy