0
点赞
收藏
分享

微信扫一扫

UIButton(loading...)


1. 按钮的文字 垂直 对齐方式

button.contentVerticalAlignment = UIControlContentVerticalAlignmentBottom; // 按钮都是有状态的, 不同状态下对应不同的标题



2. 按钮内容居左显示

_nameButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;

        

3. 设置按钮的内边距

_nameButton.contentEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0);

        

4. 按钮leble的内边距

_nameButton.titleEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0);

        

5. 居中显示

_nameButton.contentMode = UIViewContentModeCenter;

        

6. 不允许剪切超出部分

_nameButton.clipsToBounds = NO;


7. 给按钮 设置图片和标题(title) 不能用点语法(因为有状态不一样, 图片和标题也不一样)



举报

相关推荐

0 条评论