From abe4738c0faa6d2cb9dd5ee30dfb36c7fcea135c Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Mon, 27 Mar 2023 18:31:54 +0800 Subject: [PATCH] fillEqually --- Sources/ProHUD/Alert/Alert.swift | 2 +- Sources/ProHUD/Alert/AlertDefaultLayout.swift | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Sources/ProHUD/Alert/Alert.swift b/Sources/ProHUD/Alert/Alert.swift index 33eb439..3c155bf 100644 --- a/Sources/ProHUD/Alert/Alert.swift +++ b/Sources/ProHUD/Alert/Alert.swift @@ -65,7 +65,7 @@ public class Alert: ProHUD.Controller { public lazy var actionStack: StackView = { let stack = StackView() stack.alignment = .fill - stack.distribution = .fill + stack.distribution = .fillEqually stack.spacing = config.margin return stack }() diff --git a/Sources/ProHUD/Alert/AlertDefaultLayout.swift b/Sources/ProHUD/Alert/AlertDefaultLayout.swift index 69da7cc..983d23c 100644 --- a/Sources/ProHUD/Alert/AlertDefaultLayout.swift +++ b/Sources/ProHUD/Alert/AlertDefaultLayout.swift @@ -108,9 +108,8 @@ extension Alert: DefaultLayout { guard isViewDisplayed == false && config.actionAxis == nil else { return } let count = actionStack.arrangedSubviews.filter({ $0.isKind(of: UIControl.self )}).count guard count < 4 else { return } - if isPortrait && count < 3 || !isPortrait { + if (isPortrait && count < 3) || !isPortrait { actionStack.axis = .horizontal - actionStack.distribution = .fillEqually } }