2012-05-17 177 views

回答

15

您可以將這些代碼它的工作好與我

UITextField* txtfield = [[UITextField alloc]initWithFrame:CGRectMake(10, 50, 300, 32)]; 
[txtfield setBorderStyle:UITextBorderStyleNone]; 
txtfield.layer.cornerRadius = 15.0; 
txtfield.layer.borderWidth = 2.0; 
txtfield.layer.borderColor = [UIColor redColor].CGColor; 
txtfield.layer.masksToBounds = YES; 
[self.view addSubview:txtfield]; 

設置你背景在您的視圖並設置BORDERCOLOR到clearColor