开发者

Dismissing pickers and keyboards invoked by a UIWebView

开发者 https://www.devze.com 2022-12-24 16:22 出处:网络
I am implementing an in-app browser using UIWebView, that shows an \'action\' button up-top that - when tapped - scales the UIWebView and allows the user to perform some other actions.

I am implementing an in-app browser using UIWebView, that shows an 'action' button up-top that - when tapped - scales the UIWebView and allows the user to perform some other actions.

If, however, at the point of tapping this 'action' button, the user were e开发者_C百科ntering some text on the webview, or using a picker to select an option from a drop-down list, then the webview gets scaled without dismissing the keyboard/picker. Apart from being ugly, this also obscures my main view and controls.

So is there a way to make a UIWebView dismiss all associated input controls, such as keyboards/pickers, when asked to?

I tried using [myWebView resignFirstResponder] but that didn't work. Any ideas? Thanks.


Was able to do this by using [myWebView endEditing:YES]

0

精彩评论

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

关注公众号