         let top = 0 - scrollView.contentInset.top
         let targetOffsetY = targetContentOffset.pointee.y - top
         if targetOffsetY < extendedViewHeight + barHeight + underBarViewHeight {
-            if targetOffsetY < 0.5 * (extendedViewHeight + underBarViewHeight) { // both visible
-                targetContentOffset.pointee = CGPoint(x: 0, y: top)
-            } else if targetOffsetY < extendedViewHeight + underBarViewHeight + 0.5 * barHeight  { // only nav bar visible
-                targetContentOffset.pointee = CGPoint(x: 0, y: top + extendedViewHeight + underBarViewHeight)
-            } else if targetOffsetY < extendedViewHeight + barHeight {
-                targetContentOffset.pointee = CGPoint(x: 0, y: top + extendedViewHeight + barHeight + underBarViewHeight)
+            if navigationBar.shouldTransformUnderBarViewWithBar { // transform whole bar together
+                if targetOffsetY < 0.5 * (extendedViewHeight + underBarViewHeight + barHeight) {
+                    targetContentOffset.pointee = CGPoint(x: 0, y: top)
+                } else {
+                    targetContentOffset.pointee = CGPoint(x: 0, y: top + extendedViewHeight + barHeight + underBarViewHeight)
+                }
+            } else {
+                if targetOffsetY < 0.5 * (extendedViewHeight + underBarViewHeight) { // both visible
+                    targetContentOffset.pointee = CGPoint(x: 0, y: top)
+                } else if targetOffsetY < extendedViewHeight + underBarViewHeight + 0.5 * barHeight  { // only nav bar visible
+                    targetContentOffset.pointee = CGPoint(x: 0, y: top + extendedViewHeight + underBarViewHeight)
+                } else if targetOffsetY < extendedViewHeight + barHeight {
+                    targetContentOffset.pointee = CGPoint(x: 0, y: top + extendedViewHeight + barHeight + underBarViewHeight)
+                }
             }
             return
         }

        } else if shouldHideExtendedView {
            extendedViewPercentHidden = (scrollY/extendedViewHeight).wmf_normalizedPercentage
        }
        
        if !navigationBar.isBarHidingEnabled {
            navigationBarPercentHidden = 0
        } else if initialScrollY < extendedViewHeight + barHeight + underBarViewHeight {
            navigationBarPercentHidden = ((scrollY - extendedViewHeight - underBarViewHeight)/barHeight).wmf_normalizedPercentage
        } else if scrollY <= extendedViewHeight + barHeight + underBarViewHeight {

        } else {
            navigationBarPercentHidden = 1
        }

        if navigationBar.shouldTransformUnderBarViewWithBar {
            underBarViewPercentHidden = navigationBarPercentHidden
            extendedViewPercentHidden = navigationBarPercentHidden
        }

        guard navigationBarPercentHidden != currentNavigationBarPercentHidden else {
            return
        }
