UIButton 左缩进几个单位

正常情况下,UIButton的文字居中显示,如果想Button 左缩进几个单位,需要设置:

button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; button.titleEdgeInsets = UIEdgeInsetsMake(01000);

猜你喜欢

转载自blog.csdn.net/wyz670083956/article/details/124275397
今日推荐