button.titleLabel.textAlignment = NSTextAlignmentLeft; 这句无效
button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
//距左的边距为10
button.titleEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0);
button.titleLabel.textAlignment = NSTextAlignmentLeft; 这句无效
button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
//距左的边距为10
button.titleEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0);
本文标题:ios button 设置文字左对齐
本文链接:https://www.haomeiwen.com/subject/ghvydftx.html
网友评论