- 水平设置内容 可以设置一下属性
//typedef NS_ENUM(NSInteger, UIControlContentHorizontalAlignment) {
//UIControlContentHorizontalAlignmentCenter = 0,
//UIControlContentHorizontalAlignmentLeft = 1,
//UIControlContentHorizontalAlignmentRight = 2,
//UIControlContentHorizontalAlignmentFill = 3,
//UIControlContentHorizontalAlignmentLeading API_AVAILABLE(ios(11.0), tvos(11.0)) = 4,
//UIControlContentHorizontalAlignmentTrailing API_AVAILABLE(ios(11.0), tvos(11.0)) = 5,
//};
_button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; - 设置内容间距:
_button.contentEdgeInsets = UIEdgeInsetsMake(0, 16, 0, 0);
网友评论