firstButton是Custom类型的UIButton.我以编程方式将三个放在一个表的每个单元格中,因此:
[firstButton setImage:markImage forState:UIControlStateNormal];
[firstButton setContentMode:UIViewContentModeScaleAspectFit];
[cell.contentView addSubview:firstButton];
Run Code Online (Sandbox Code Playgroud)
在其他地方,我告诉它clipToBounds.我得到的是图像中心方块的裁剪,而不是它的纵横比例渲染.我已经尝试了很多方法,包括在firstButton.imageView上设置mode属性,这似乎也不起作用.