Questions tagged «contentmode»


16
UIButton是否不收听内容模式设置?
firstButton是自定义类型的UIButton。我以编程方式将它们中的三个放在表的每个单元格上,因此: [firstButton setImage:markImage forState:UIControlStateNormal]; [firstButton setContentMode:UIViewContentModeScaleAspectFit]; [cell.contentView addSubview:firstButton]; 在其他地方,我告诉它是clipToBounds。我得到的是图像中心正方形的裁剪,而不是图像的纵横比渲染。我尝试了很多方法,包括在firstButton.imageView上设置mode属性,这似乎也不起作用。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.