以按钮为例:
UIButton btn = [UIButton new];
btn.layer.masksToBounds = YES;
btn.layer.cornerRadius = 10.0;
btn.layer.width = 2.0;
btn.layer.borderColor = [UIColor redColor].CGColor;
btn.layer.borderWidth = 2.0;
[btn setTitle:@"刷新" forState:UIControlStateNormal];
btn.titleLabel.font = [UIFont systemFontOfSize:15];