设置Button为圆角。且去除了Button的按下时的状态。
UIButton *btn2 = [[UIButton alloc]initWithFrame:CGRectMake(5, 70, 310, 52)];
UIImage *img2 = [UIImage imageNamed:@"poker_tab_bg@2x.png"];
[btn2 setBackgroundImage:[img2 stretchableImageWithLeftCapWidth:20 topCapHeight:0] forState:UIControlStateNormal];
btn2.adjustsImageWhenHighlighted = NO;
btn2.layer.backgroundColor =[UIColor orangeColor].CGColor;
NSLog(@"default cornerRadius is %f, default borderwidth is %f, buttontype is %d", btn2.layer.cornerRadius, btn2.layer.borderWidth, btn2.buttonType);
btn2.layer.cornerRadius = 10.0;
btn2.layer.borderWidth = 1.0;
//btn2.layer.borderColor = [UIColor grayColor].CGColor;