将 a 添加UIButton到UITableView. 下面是我设置UIButton图像的代码:
UIImage *image = [UIImage imageWithContentsOfFile:imagePath];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setImage:image forState:UIControlStateNormal];
但是当我使用imageName:方法而不是imageWithContentsOfFile:方法时,它工作得很好。有人对这个问题有很好的解决方案吗?