目前我有两种在单元格中显示图像的方式,哪种方式有助于表格顺利运行,我稍后会使用lazytable?在每个单元格中应该给按钮一个 setimage 还是添加一个带有 set image 的 imageview 一样好?同样在第一种方法中,我必须动态缩放每个图像。谢谢!
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *img = [UIImage imageWithData:"png image from url"];
[button setImage:img forState:UIControlStateNormal];
/// Or
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *img = [UIImage imageWithData:"png image from url"];
UIImageView *imageView2 = [[UIImageView alloc] initWithImage:img];
[button2 addSubview:imageView2];