Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用分段的 TableView,我想在单元格的左侧显示一个图像。如果我从照片库(模拟器中的示例照片中)选择一张并将其设置为 UITableViewCell.imageView.image,它将占据整个屏幕。
如何调整图像大小以使其完全适合单元格的图像视图?
谢谢,
亚辛
这与如何按比例缩放 UIImageView基本上是相同的问题?,这有一个很好的答案。
将该类别添加到您的项目中,并使用您的视图大小调用它。我已经使用了代码并且效果很好。