试图找出如何为 tableViewCell
设置所选图像。
旧的写法是 cell.selectedImage
但自 3.0 以来已被弃用。
我已经尝试了很多东西,但还是不太行。
谢谢! 乔希
最佳答案
根据Deprecated UITableViewCell Methods doc,您应该使用 imageView 的 highlightedImage 属性代替 selectedImage。例如:
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
cell.imageView.image = [UIImage imageNamed:@"deselected_image.png"];
cell.imageView.highlightedImage = [UIImage imageNamed:@"selected_image.png"];
关于iphone - UITableViewCell 设置选中图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4988777/