                 var frame = view.frame
                 if view.tag == 0 {
                     // On the first layout we work out what the actual position should be by applying our offset to the default position.
-                    frame.origin.y = (CGFloat(navBarHeight) - view.frame.size.height)/2
+                    frame.origin.y = (CGFloat(height) - view.frame.size.height)/2
                     view.tag = Int(frame.origin.y)
                 }
                 else{

        
        guard let superview = self.superview else {return size}
        
        var height = navBarHeight + verticalSpacing
        if UIApplication.shared.isStatusBarHidden || UIApplication.shared.statusBarFrame.height > 20 {  //Larger than 20 means double height status bar (e.g. in call)
            height += 5
        }

    
    func setupAppearance() {
        // Compensate for height change by moving back button
        let offset : CGFloat = (44 - CGFloat(height))/2
        
        TDRoundedNavigationBar.appearance().setTitleVerticalPositionAdjustment(offset, for: UIBarMetrics.default)
        TDRoundedNavigationBar.appearance().setTitleVerticalPositionAdjustment(offset - 5, for: UIBarMetrics.compact)
