改变Button文字和图片的位置

button.imageEdgeInsets = UIEdgeInsetsMake(0, labelWidth, 0, -labelWidth);
button.titleEdgeInsets = UIEdgeInsetsMake(0, -imageWith, 0, imageWith);

获取图片宽度:CGFloat imageWidth = button.imageView.bounds.size.width;

原文地址:https://www.cnblogs.com/wlsxmhz/p/5462754.html