正常情况下,UIButton的文字居中显示,如果想Button 左缩进几个单位,需要设置:
button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; button.titleEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0);
正常情况下,UIButton的文字居中显示,如果想Button 左缩进几个单位,需要设置:
button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; button.titleEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0);