UIButton常用属性
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setFrame:CGRectMake(btnX, btnY, btnWidth, btnHeight)];
button.layer.borderWidth = 1; // 边框宽度设置为1
[button setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft]; // 左对齐
button.layer.backgroundColor = [UIColor redColor].CGColor; // 修改背景色
btn.titleLabel.font = [UIFont systemFontOfSize: 14.0]; // 字体大小