输入框圆角实现方法

UIView *testView = [[UIView alloc] initWithFrame:CGRectMake(20, 20, 300, 50)];
[testView.layer setMasksToBounds:true];
[testView.layer setBorderColor:[UIColor grayColor].CGColor];
[testView.layer setBorderWidth:2];
[testView.layer setCornerRadius:6];
[contentView addSubview:testView];

你可能感兴趣的:(方法)