设置按钮的contentMode, 让其图片居中填充显示

来源:互联网 发布:淘宝限时打折怎么设置 编辑:程序博客网 时间:2024/05/22 04:38

UIButton *button;

[[button imageViewsetContentMode:UIViewContentModeScaleAspectFill];

 button.contentHorizontalAlignmentUIControlContentHorizontalAlignmentFill;

 button.contentVerticalAlignment = UIControlContentVerticalAlignmentFill;

阅读全文
0 0
原创粉丝点击