Sfoglia il codice sorgente

toast message居中

huzhiqiang 3 anni fa
parent
commit
ade6d51eab
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 4 2
      BFFramework/Classes/Utils/PQCommonMethodUtil.swift

+ 4 - 2
BFFramework/Classes/Utils/PQCommonMethodUtil.swift

@@ -424,17 +424,19 @@ public func getMachineCode() -> String {
 /// - Returns: <#description#>
  public func cShowHUB(superView: UIView?, msg: String?) {
     DispatchQueue.main.async {
+        var sty : ToastStyle = ToastManager.shared.style
+        sty.messageAlignment = .center
         if superView == nil {
             if msg == nil {
                 UIApplication.shared.keyWindow?.makeToastActivity(.center)
             } else {
-                UIApplication.shared.keyWindow?.makeToast(msg, duration: 3.0, position: .center)
+                UIApplication.shared.keyWindow?.makeToast(msg, duration: 3.0, position: .center, style: sty)
             }
         } else {
             if msg == nil {
                 superView!.makeToastActivity(.center)
             } else {
-                superView!.makeToast(msg, duration: 3.0, position: .center)
+                superView!.makeToast(msg, duration: 3.0, position: .center, style: sty)
             }
         }
     }