diff --git a/Reader/Screens/Read/ReadViewController.swift b/Reader/Screens/Read/ReadViewController.swift index 0477fc0..24f3adb 100644 --- a/Reader/Screens/Read/ReadViewController.swift +++ b/Reader/Screens/Read/ReadViewController.swift @@ -81,10 +81,12 @@ class ReadViewController: UIViewController { webView.scrollView.alwaysBounceHorizontal = false view.addSubview(webView) + // subtract 0.5, because otherwise, on ipad, the web view's scroll content view ends up being wider than the scroll view itself, causing the content to bounce horizontally + let webViewWidthFix = UIDevice.current.userInterfaceIdiom == .pad ? -0.5 : 0 + NSLayoutConstraint.activate([ webView.leadingAnchor.constraint(equalTo: view.leadingAnchor), - // subtract 0.5, because otherwise, on ipad, the web view's scroll content view ends up being wider than the scroll view itself, causing the content to bounce horizontally - webView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -0.5), + webView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: webViewWidthFix), webView.topAnchor.constraint(equalTo: view.topAnchor), webView.bottomAnchor.constraint(equalTo: view.bottomAnchor), ])