//文字在靠在最左边 (右边为Right)
button.contentHorizontalAlignment =UIControlContentHorizontalAlignmentLeft;
//文字靠在最顶部 (底部为bottom)
button.contentVerticalAlignment = UIControlContentVerticalAlignmentTop;
//文字在靠在最左边 (右边为Right)
button.contentHorizontalAlignment =UIControlContentHorizontalAlignmentLeft;
//文字靠在最顶部 (底部为bottom)
button.contentVerticalAlignment = UIControlContentVerticalAlignmentTop;