Skip to content

Commit

Permalink
Merge pull request #2133 from minvws/bugfix/5002-bottom-margins-details
Browse files Browse the repository at this point in the history
  • Loading branch information
Rool authored Oct 27, 2022
2 parents 3f6a146 + a0a9a73 commit cad5169
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ class IdentitySelectionDetailsView: BaseView {
stackView.spacing = ViewTraits.Spacing.stackSpacing
return stackView
}()

private let spacer: UIView = {
let view = UIView()
view.translatesAutoresizingMaskIntoConstraints = false
view.backgroundColor = .clear
return view
}()

override func setupViews() {

Expand All @@ -66,6 +73,7 @@ class IdentitySelectionDetailsView: BaseView {
addSubview(titleLabel)
addSubview(contentTextView)
addSubview(detailsStackView)
addSubview(spacer)
}

override func setupViewConstraints() {
Expand All @@ -74,6 +82,7 @@ class IdentitySelectionDetailsView: BaseView {
setupTitleLabelViewConstraints()
setupContentTextViewConstraints()
setupDetailsStackViewConstraints()
setupSpacerViewConstraints()
}

func setupTitleLabelViewConstraints() {
Expand Down Expand Up @@ -137,11 +146,24 @@ class IdentitySelectionDetailsView: BaseView {
constant: -2 * ViewTraits.Margin.edge
),
detailsStackView.bottomAnchor.constraint(
equalTo: safeAreaLayoutGuide.bottomAnchor,
equalTo: spacer.topAnchor,
constant: -ViewTraits.Margin.bottom
)
])
}

func setupSpacerViewConstraints() {

NSLayoutConstraint.activate([
spacer.topAnchor.constraint(equalTo: detailsStackView.bottomAnchor),
spacer.leadingAnchor.constraint(equalTo: leadingAnchor),
spacer.trailingAnchor.constraint(equalTo: trailingAnchor),
spacer.bottomAnchor.constraint(
equalTo: safeAreaLayoutGuide.bottomAnchor,
constant: UIDevice.current.hasNotch ? 0 : -ViewTraits.Margin.bottom
)
])
}

// MARK: Public Access

Expand Down

0 comments on commit cad5169

Please sign in to comment.