fillEqually

This commit is contained in:
xaoxuu 2023-03-27 18:31:54 +08:00
parent d06fb00c6f
commit abe4738c0f
2 changed files with 2 additions and 3 deletions

View File

@ -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
}()

View File

@ -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
}
}