iphone中,在编辑文本时怎么设置UITextView
的边框颜色?
下面的代码没有实现。
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
textField.layer.borderColor=[[UIColor cyanColor] CGColor];
}
iphone中,在编辑文本时怎么设置UITextView
的边框颜色?
下面的代码没有实现。
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
textField.layer.borderColor=[[UIColor cyanColor] CGColor];
}
加上:#Import <QuartzCore/QuartzCore.h>
用下面的代码就行:
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
textField.layer.cornerRadius=8.0f;
textField.layer.masksToBounds=YES;
textField.layer.borderColor=[[UIColor redColor]CGColor];
textField.layer.borderWidth= 1.0f;
return YES;
}