标签:数值 interface ios uibutton center ret ace 上下 har
新建一个UIButton的category
.h
@interface UIButton (QXTitleInCenter) -(instancetype)init; @end
.m
@implementation UIButton (QXTitleInCenter) -(instancetype)init{ self = [super init]; self.contentEdgeInsets = UIEdgeInsetsMake(-(self.intrinsicContentSize.height) * 0.18(调节文字上下高度的,数值越大文字越靠上方),0, 0, 0); return self; } @end
然后引入这个category,直接用UIButton就OK了
标签:数值 interface ios uibutton center ret ace 上下 har
原文地址:http://www.cnblogs.com/ansyxpf/p/6117247.html