1.
点击之后会发光
btn.showsTouchWhenHighlighted = YES;
btn是点击事件
或者是btn按钮
2.
设置边框
首先要把边框属性设置成YES,而且必须设置颜色
[button.layer setMasksToBounds:YES];
然后设置边框宽度
button.layer.borderWidth = 1.0;
设置圆角的话需要添加以下属性
[button.layer setConrenerRadius:10.0];
颜色设置可以喽跟平常颜色不一一样
button.layer.borderColor = [UIColor grayColor].CGColor;
后面必须加上CGColor,原因别问我 我也不知道
设置边框颜色
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CFColor colorReF = cgcOLORcREATE(colorSpeace ,(CGFloat[]) {0,0,0,1}
);[button.layer setBorderColor:colorRef ];
3.
字体的大小
button.titleLabel.font = [UIFont systemFontOfSize:20];
字体型号和大小
button.titleLabel.font = [UIFont fontWithName:@”字体名称” size:字体大小]
4.
字体居中
button.contentHorizontalAlignment
=UIControlContentHorizontalAlignmentCenter;