UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 64)];iview
[self.view addSubview:view];ui
[view setBackgroundColor:[UIColor whiteColor]];spa
//設置uiview 的邊框寬度
3d
view.layer.borderWidth = 1;orm
//設置uiview 的邊框顏色
it
view.layer.borderColor = [[UIColor colorWithRed:0 green:255/255.0f blue:0 alpha:1] CGColor];margin
//設置圓角
top
UITextField *field = [[UITextField alloc] init];di
//設置邊框風格
view
[field setBorderStyle:UITextBorderStyleRoundedRect];
//設置邊框寬度
field.layer.borderWidth = 1;
//設置邊框顏色
field.layer.borderColor=[[UIColor blueColor] CGColor];
//設置圓角弧度
field.layer.cornerRadius = 3;