开发者

Iphone: uitextview setting done button

开发者 https://www.devze.com 2023-01-12 01:36 出处:网络
I use a UITextView in my application. The text editing is ok. I set the return button to Done. When I finish the editing, I l开发者_C百科ike to hide the keyboard with the done button.

I use a UITextView in my application. The text editing is ok. I set the return button to Done. When I finish the editing, I l开发者_C百科ike to hide the keyboard with the done button. My Question: How can I set the done button?

Thanks, Balu.


Set your controller as the textField's Delegate, implement UITextField Delegate method textFieldShouldReturn in your controller and resign first responder before returning TRUE/YES:

- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消