UIWebView scrolling down on input focus iOS 6 only

后端 未结 3 1596
面向向阳花
面向向阳花 2021-02-02 15:45

I\'m loading a UIWebView in a modal. The web page has some inputs that work exactly as intended in iOS 5. However in iOS 6, anytime an input gets focus, the keyboard is doing it

3条回答
  •  不知归路
    2021-02-02 16:17

    A workaround could be disabling the scroll in this UIWebView :

    UIScrollView *scrollView = webView.scrollView;
    [scrollview setScrollEnabled:NO];
    [scrollView bounces:NO];
    

    Another could be setting the UIEdgeInsets of this scrollView but I don't know much about this.

    I think this is a standard behaviour in both iOS 5 and 6 to scroll to make the input field just on top of te keyboard (just like Safari does).

提交回复
热议问题