延期
extension UITableViewCell {
func prepareDisclosureIndicator() {
for case let button as UIButton in subviews {
let image = button.backgroundImageForState(.Normal)?.imageWithRenderingMode(.AlwaysTemplate)
button.setBackgroundImage(image, forState: .Normal)
}
}
}
斯威夫特 3:
extension UITableViewCell {
func prepareDisclosureIndicator() {
for case let button as UIButton in subviews {
let image = button.backgroundImage(for: .normal)?.withRenderingMode(.
alwaysTemplate)
button.setBackgroundImage(image, for: .normal)
}
}
}
做吧
override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
cell.prepareDisclosureIndicator()
}
迅速 3:
override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
cell.prepareDisclosureIndicator()
}
目标-C:
for (UIView *subview in cell.subviews) {
if ([subview isMemberOfClass:[UIButton class]]) {
UIButton *button = (UIButton *)subview;
UIImage *image = [[button backgroundImageForState:UIControlStateNormal] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[button setBackgroundImage:image forState:UIControlStateNormal];
}
}