How can I stop scrolling when i focus in UIWebview - ios

I have an iOS app use a UIWebView, and there are some textfield views on the UIWebview's scrollview, when I focus in UIWebview after focus in textfield, the view will scroll and the keyboard will jump, it is terrible.
what can i do?

Related

Xamarin Forms: Prevent Keyboard resizing the view

we have a WebView inside of a Grid. When I touch inside a control of my webview the Keyboard will show and resize my view. Is it possible to avoid the Keyboard from resizing or moving my view? the webview should stays where it is. the Keyboard should be lay over my webview and should not be scrollable.

Keyboard does not dismiss interactively

On an iOS app, I have the following view structure:
UIViewController > UIView > UIScrollView > UITextView
The UIScrollView has the "Dismiss Interactively" setting. When I tap on the UITextView, the keyboard pops-up properly. However I now try to gradually dismiss the keyboard by slowly swiping my finger down, but nothing happens.
Did I forget anything in my configuration ?
Example project
Since iOS 7, you can use
scrollView.keyboardDismissMode = .Interactive
The keyboard follows the dragging touch offscreen and can be pulled upward again to cancel the dismiss.
Issue was linked to the fact that the scrollView contents were shorter than the screen size.

UIKeyboardTypeNumberPad hides bottom of view

Newbie alert...
I'm updating some code that has a UITextField with a keyboardType of UIKeyboardTypeNumberPad. In the view, which is in a UIScrollView, there is also a save and cancel button below the textfield. When you tap the textfield, the cancel button is not visible and you cannot scroll to it.
Is there a typical approach for this scenario to make the cancel button accessible when the keyboard pops up?
Is the idea to just manually increase the UIScrollView content size when the keyboard displays and then decrease it when it is dismissed or is there a simpler way of achieving this?

UIWebView hidden by keyboard

I have iPad app with view and uiwebview in it. It is on the bottom with size smaller than keyboard (e.g. 300x200). In webview is page with form loaded.
When I tap into some textfield, keyboard pops up and hides whole uiwebview. With iOS simulator and slow animation mode I can see, that webview is scrolled, but when it is smaller then keyboard and at the bottom, it is useless. Webview is covered with keyboard.
I have mastered moving hidden content by keyboard according managing keyboard documentation but when i set scrollview offset, webview still do the scrolling and scrolls text input away. There isn't way of setting webview offset.
Also I found in UIWebView class reference important note that embed webview in scrollview won't work correctly.
It seems to me i have come across easy problem but with no solution on the Internet. So am I first who wants to have uiwebview smaller than fullscreen? Is it app Store correct to have small uiwebview? What to do if UIWebView is hidden by keyboard?
Thanks for any notes and suggestions.
You can hide the keyboard when the webView is scrolled, try this:
self.webView.scrollView.keyboardDismissMode =UIScrollViewKeyboardDismissModeOnDrag;
What i would do is Keyboard notifications. You can scroll the view upwards using the methods provided by the UIView class nad this link should help you out greatly.
Keyboard Hiding Screen

How do I make my UITextView autoscroll when dragging caret to the edge of view?

In the iOS's Notes app, I wrote very long text on the TextView,
then I long press on the view, bring up the magnifier loupe, drag it to the bottom of screen (or top of the keyboard, if it is activated), the TextView will automatically scroll up.
How can I implement this with UITextView?
I tried
Add a UILongPressGestureRecognizer to my UITextView subclass, but its action never get called.
Override touchesMoved:withEvent: method in my UITextView subclass, but this method will not be called after the magnifier loupe appears.
You don't implement it; that's standard behaviour.
The magnifier scrolling occurs when you drag the magnifier off the bottom or off the top of the UITextView, or when you're close on the edge, about 10 pixels? (best to test this in the simulator where to have exact-control over the touch-position). If your text view is full-screen you may not be able to drag to a position outside the view, and the touch-region for scrolling may just be too small.
Notice in the Notes app that to scroll down you can drag the magnifier onto the tabs at the bottom. To go up you can drag it into the title. So long as you hold the touch outside the view it'll scroll.
All this also means your view can't go behind the keyboard when it's present. You need to resize the UITextView when the keyboard appears to get the scrolling to work.

Resources