如何以编程方式设置uitextfield和UITextView
边框颜色,当我们在textfield和textview中输入或编辑时。如何在iphone应用程序中设置uitextfield bordercolor
我使用此代码,但不更改UITextView
的边框颜色。
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
textField.layer.borderColor=[[UIColor cyanColor] CGColor];
}
到
你可以阅读更多有关文档的
UITextFieldDelegate
方法你有没有包括QuartzCore框架到您的建立阶段? – 2013-03-22 14:14:39@ste prescott是的,我包含quartzCore框架到我的构建阶段。但是当我编辑文本字段时,它不应该改变边框颜色。 – raman 2013-03-22 14:18:12
@raman:你有没有试过我的答案? – Bhavin 2013-03-22 14:41:44