1.layer层设置
self.myButton = [[UIButton alloc] initWithFrame:self.bounds]; self.myButton.layer.cornerRadius = (self.myButton.frame.size.width - 1) / 2;//圆形 self.myButton.clipsToBounds = true; (self.myButton.layer.masksToBounds = YES;) //设置边框及其颜色 self.myButton.layer.borderWidth = 1.0; self.myButton.layer.borderColor = [[UIColor whiteColor] CGColor];self.myButton = [[UIButton