fix settings screen

pull/699/head
ryanzhao 3 years ago
parent 15694aeeb0
commit ccc517746d

@ -114,17 +114,7 @@ class SessionAvatarCell: UITableViewCell {
stackView.alignment = .center stackView.alignment = .center
stackView.distribution = .fillEqually stackView.distribution = .fillEqually
stackView.spacing = (UIDevice.current.isIPad ? Values.iPadButtonSpacing : Values.mediumSpacing) 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 return stackView
}() }()
@ -242,6 +232,10 @@ class SessionAvatarCell: UITableViewCell {
descriptionSeparator.update(title: style.separatorTitle) descriptionSeparator.update(title: style.separatorTitle)
descriptionSeparator.isHidden = (style.separatorTitle == nil) descriptionSeparator.isHidden = (style.separatorTitle == nil)
if (UIDevice.current.isIPad) {
descriptionActionStackView.addArrangedSubview(UIView.hStretchingSpacer())
}
style.descriptionActions.forEach { action in style.descriptionActions.forEach { action in
let result: SessionButton = SessionButton(style: .bordered, size: .medium) let result: SessionButton = SessionButton(style: .bordered, size: .medium)
result.setTitle(action.title, for: UIControl.State.normal) result.setTitle(action.title, for: UIControl.State.normal)
@ -252,6 +246,10 @@ class SessionAvatarCell: UITableViewCell {
descriptionActionStackView.addArrangedSubview(result) descriptionActionStackView.addArrangedSubview(result)
} }
if (UIDevice.current.isIPad) {
descriptionActionStackView.addArrangedSubview(UIView.hStretchingSpacer())
}
descriptionActionStackView.isHidden = style.descriptionActions.isEmpty descriptionActionStackView.isHidden = style.descriptionActions.isEmpty
} }

Loading…
Cancel
Save