开发者

iPhone:Need to keep the keyboard up while scrolling the webview?

i have an application where half screen will show a website and half screen will be covered with the keyboard(Not the webview's default keyboard). Keyboard has a textfield with it and user can write to the text field and send to the web page(i have used javascript there).

Now i need to keep the keyboard up while user typing and sending text to开发者_如何学JAVA the webview..,but while user scrolls the webview by touching ...the keyboards hides. I tried the keyBoarWillHide method to make the keyboard becomefirstresponder....but no result.

any idea while scrolling webview will not hide the keyboard?


You said you are not using the default keyboard, so it means you created your keyboard? If is that the case then you should be able to control it by 100%

If you are just putting some layer or view on the default keyboard I don't have many ideas.

The thing is that the keyboard appears when something like UITextField UITextView ( or some text input-able UI Object) becomes first responder. Then, if the first responder Object is not text input-able keyboard will hide. So, When you touch an UIWebView object, this becomes the first responder and since is not text inputable, the keyboard hides.

I don't know what happens it you write something like [webview canBecomeFirstResponder:NO]; In theory this should work.


You can hold onto first responder by returning NO to - (BOOL)resignFirstResponder - beware of the impact this can have on your UI though, nothing more annoying than being made to jump through the programmer's hoops before you can move on.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜