如何以編程方式設置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