-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MBL-1374: Handle long add-on names on late pledge confirmation page #2055
MBL-1374: Handle long add-on names on late pledge confirmation page #2055
Conversation
override func viewWillLayoutSubviews() { | ||
super.viewWillLayoutSubviews() | ||
|
||
self.tableViewContainerHeightConstraint?.constant = self.tableView.intrinsicContentSize.height |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This constraint needed to be updated; otherwise it squashes the table.
} | ||
|
||
private func rootStackViewStyle(_ isAccessibilityCategory: Bool) -> (StackViewStyle) { | ||
let alignment: UIStackView.Alignment = (isAccessibilityCategory ? .center : .top) | ||
let axis: NSLayoutConstraint.Axis = (isAccessibilityCategory ? .vertical : .horizontal) | ||
let distribution: UIStackView.Distribution = (isAccessibilityCategory ? .equalSpacing : .fill) | ||
let distribution: UIStackView.Distribution = (isAccessibilityCategory ? .equalSpacing : .fillProportionally) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only behavioral change in this function; the rest is just making the Prelude-y bits less Prelude-y. (Which had the benefit of fixing a warning about type check taking 2000 ms!)
override func layoutSubviews() { | ||
super.layoutSubviews() | ||
self.titleLabel.preferredMaxLayoutWidth = self.titleLabel.frame.size.width | ||
super.layoutSubviews() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugly little hack to make multi-line labels work properly in automatically sized cells.
aee4baf
to
dcfa58c
Compare
📲 What
In the summary view for late pledge confirmation,
🤔 Why
Long add-on names would break the summary view:
👀 See
Here's the same project, fixed:
Here's an example of it working, with a very long hard-coded string:
As well as working with the largest font size: