UIButton的相关设置

UIButton  *button = [[UIButton alloc] init]; 

//边框颜色

button.layer.borderColor = kMainColor.CGColor;

//边框宽度

button.layer.borderWidth = 1;

//圆角

button.layer.masksToBounds = YES;

//圆角弧度

button.layer.cornerRadius = 3;

//图标 文字偏移量

button.imageEdgeInsets = UIEdgeInsetsMake(0,0,0,0);

button.titleEdgeInsets = UIEdgeInsetsMake(0, 2, 0, 0);

你可能感兴趣的:(UIButton的相关设置)