UIButton *btn; [btn.layer setMasksToBounds:YES]; [btn.layer setCornerRadius:10.0];//设置矩形四个圆角半径 /* [btn.layer setBorderWidth:1.0];//边框宽度 */