UIButton 设置图片显示 contentmode
2018-07-31 本文已影响217人
我们只是GitHub的搬运工
UIButton 设置图片显示contentmode
只设置contentmode是没有效果的
UIButton *button;
button.contentEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0);
[[button imageView] setContentMode:UIViewContentModeScaleAspectFill];
button.contentHorizontalAlignment= UIControlContentHorizontalAlignmentFill;
button.contentVerticalAlignment = UIControlContentVerticalAlignmentFill;