Fixed header disappear when scrolling down in webview in iOS 11

I’m just writing some code, try with one by one

  • Try with below

    self.automaticallyAdjustsScrollViewInsets = false
    
  • Try with below

    [self.webView.scrollView setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
    
  • Try with below (change your code)

    header {
        height: 60px;
        background-color: @mainColor;
        color: #ffffff;
        padding: 10px;
        text-align: center;
        position: fixed;
        width: 100%;
        z-index: 1;
        transform: translateZ(0);
        -moz-transform: translatez(0);
        -ms-transform: translatez(0);
        -o-transform: translatez(0);
        -webkit-transform: translateZ(0);
        -webkit-font-smoothing: antialiased;
    }
    

    And some helpful links might be useful for you!

  • Understanding the WebView Viewport in iOS 11

  • https://forums.developer.apple.com/thread/90472
  • How to fix the iOS 11 input element in fixed modals bug
  • https://github.com/PierBover/ios-iframe-fix
  • https://stanko.github.io/ios-safari-scoll-position-fixed/

From Apple official note:

Important:

Starting in iOS 8.0 and OS X 10.10, use WKWebView to add web content to your app. Do not use UIWebView or WebView.

So you should try once with WKWebView.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)