UIButton 设置图片显示 contentmode

UIButton 设置图片显示contentmode

只设置contentmode是没有效果的

UIButton *button;


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

[[button imageView] setContentMode:UIViewContentModeScaleAspectFill];


 button.contentHorizontalAlignment= UIControlContentHorizontalAlignmentFill;

 button.contentVerticalAlignment = UIControlContentVerticalAlignmentFill;

你可能感兴趣的:(UIButton 设置图片显示 contentmode)