From ccc517746d409d39ee7716fcadba3551a783aeb4 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Wed, 5 Oct 2022 11:58:58 +1100 Subject: [PATCH] fix settings screen --- Session/Shared/Views/SessionAvatarCell.swift | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Session/Shared/Views/SessionAvatarCell.swift b/Session/Shared/Views/SessionAvatarCell.swift index 8016641bb..3ccea1689 100644 --- a/Session/Shared/Views/SessionAvatarCell.swift +++ b/Session/Shared/Views/SessionAvatarCell.swift @@ -114,17 +114,7 @@ class SessionAvatarCell: UITableViewCell { stackView.alignment = .center stackView.distribution = .fillEqually stackView.spacing = (UIDevice.current.isIPad ? Values.iPadButtonSpacing : Values.mediumSpacing) - - if (UIDevice.current.isIPad) { - stackView.layoutMargins = UIEdgeInsets( - top: 0, - left: Values.iPadButtonContainerMargin, - bottom: 0, - right: Values.iPadButtonContainerMargin - ) - stackView.isLayoutMarginsRelativeArrangement = true - } - + return stackView }() @@ -242,6 +232,10 @@ class SessionAvatarCell: UITableViewCell { descriptionSeparator.update(title: style.separatorTitle) descriptionSeparator.isHidden = (style.separatorTitle == nil) + if (UIDevice.current.isIPad) { + descriptionActionStackView.addArrangedSubview(UIView.hStretchingSpacer()) + } + style.descriptionActions.forEach { action in let result: SessionButton = SessionButton(style: .bordered, size: .medium) result.setTitle(action.title, for: UIControl.State.normal) @@ -252,6 +246,10 @@ class SessionAvatarCell: UITableViewCell { descriptionActionStackView.addArrangedSubview(result) } + + if (UIDevice.current.isIPad) { + descriptionActionStackView.addArrangedSubview(UIView.hStretchingSpacer()) + } descriptionActionStackView.isHidden = style.descriptionActions.isEmpty }