Tôi gặp sự cố khi hiển thị phụ kiện Dấu kiểm trong ô của mình. Khi tôi sử dụng một loại phụ kiện khác, nó hoạt động nhưng không sử dụng phụ kiện Dấu kiểm.UITableViewCellAccessoryCheckmark không hiển thị trong iOS 7
Nó hoạt động hoàn hảo trong iOS 6 nhưng không hoạt động trên iOS 7. Khi nào tôi bị thiếu?
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:EVENT_SELECTION_CELL_IDENTIFIER forIndexPath:indexPath];
Event *event = [self.fetchedResultsController objectAtIndexPath:indexPath];
cell.textLabel.text = event.name;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if ([event.current boolValue]) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
} else {
cell.accessoryType = UITableViewCellAccessoryNone;
}
return cell;
}
Họ đã thay đổi mặc định trong ios7. :) Ô có màu nền mặc định khi được chọn. Trong iOS 7, màu lựa chọn không còn màu xanh. Thay vào đó hãy sử dụng * UITableViewCellSelectionStyleDefault *. phiên bản float = [[[UIDevice currentDevice] systemVersion] floatValue]; nếu (phiên bản> = 7.0) { cell.selectionStyle = UITableViewCellSelectionStyleDefault; } else { cell.selectionStyle = UITableViewCellSelectionStyleNone; } –
Tôi có cùng một vấn đề. Xem câu hỏi của tôi ở đây: http://stackoverflow.com/questions/19249389/checkmark-wont-show-in-tableviewcell-on-ios7/19418537 – audience