给uiview 添加边框以及圆角

    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 blueColorCGColor];


    //设置圆角弧度

    field.layer.cornerRadius = 3;