美文网首页
UIButton 设置图片显示 contentmode

UIButton 设置图片显示 contentmode

作者: 我们只是GitHub的搬运工 | 来源:发表于2018-07-31 10:13 被阅读217次

UIButton 设置图片显示contentmode

只设置contentmode是没有效果的

UIButton *button;


 button.contentEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0);

[[button imageView] setContentMode:UIViewContentModeScaleAspectFill];


 button.contentHorizontalAlignment= UIControlContentHorizontalAlignmentFill;

 button.contentVerticalAlignment = UIControlContentVerticalAlignmentFill;

相关文章

网友评论

      本文标题:UIButton 设置图片显示 contentmode

      本文链接:https://www.haomeiwen.com/subject/blycvftx.html