瀏覽代碼

coding - test

marinofaggiana 4 年之前
父節點
當前提交
6442cf546f
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      iOSClient/Utility/NCPopupViewController.swift

+ 6 - 1
iOSClient/Utility/NCPopupViewController.swift

@@ -191,8 +191,13 @@ public class NCPopupViewController: UIViewController {
                 }
                 
                 if keyboardPosizionEnabled {
+                    
+                    var y2 = screenSize.height - (popupHeight ?? 0)
+                    if y2 < 0 { y2 = 0 }
+                    let diff = abs(y2 - keyboardSize.height)
+                    
                     if centerYConstraint != nil {
-                        centerYConstraint?.constant = -(keyboardSize.height/2)
+                        centerYConstraint?.constant = -(diff + 10)
                     }
                 }
             }