Мне нужно изменить цвет аксессуара disclosureIndicatorView
в UITableViewCell
.
Я думаю, что есть два способа сделать это, но я не могу понять, какой из них оптимальный. Итак, вот что я думаю, что могу сделать.
Существует свойство UITableViewCell
- accessoryView
. Поэтому я могу использовать setAccessoryView:(UIView *)view
и просматривать представление как UIImageView
, удерживая изображение, которое я хочу.
Я написал класс утилиты, который создает представление содержимого (например, цвет фона, добавление другого материала и т.д.) для моей ячейки, и я добавляю этот просмотр содержимого в ячейку в UITableViewDelegate
. Другой вариант - сделать UIImage
переопределением метода drawRect
класса утилиты CustomContentView
.
Исполнение опции 1 - Я могу сделать все по-яблочному. Просто дайте им представление, и они сделают все остальное. Но я предполагаю, что добавление нового объекта UIView
к каждой строке может оказаться значительным распределением объектов и уменьшением частоты кадров. По сравнению с одним объектом UIImage
в моем contentView
. Я считаю, что UIImage
легче, чем UIView
.
Пожалуйста, бросьте некоторых светлых людей и помогите мне решить его.