开发者

How hide the KeyBoard in UITableView

开发者 https://www.devze.com 2023-02-15 01:01 出处:网络
I read a lot of thing, but anyone asked me.I am in a (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;

I read a lot of thing, but anyone asked me. I am in a

(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;

So the user clicked in my tableView. I 开发者_高级运维am not in a UITextField. All I want is say to Keyboard screen go away animated, like when it close normally. How can I do this command:

[keyboard goway];


To dismiss the keyboard, you need to call resignFirstResponder. First though, you need figure out what object is first responder.

It's usually a textField, but it can be other things. For this example, you would call

[textField resignFirstResponder];

What object is using the keyboard? We may be able to help you further.


the UITableView should call becomeFirstResponder

Or, I guess a much easier way is not to rely on the UIKeyboardWillShowNotification, instead, you hijack the click event of the TextBox in your html, and run document.location = 'blablabla'; preventDefault();, then your uiwebview delegate will knew it's time to call out the UITableView. This way is better because keyboard won't even show up.

0

精彩评论

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