Open SpacyRicochet opened 9 years ago
Yeah - I've come across a similar issue. I'm not sure if the UILabel
is ignoring its preferredMaxLayoutWidth
or its something else. Hopefully it'll be fixed by final release.
I haven't tried this, but have you looked at sub-classing UILabel
and then in layoutSubviews
setting preferredMaxLayoutWidth
to bounds.width - 1
?
Cheers,
Rich
I've also experienced this issue (as of iOS 9/Xcode 7 beta 3) and doing what rhodgkins suggested worked!
class FixedLabel: UILabel {
override func layoutSubviews() {
super.layoutSubviews()
preferredMaxLayoutWidth = bounds.width - 1
}
}
I also hope that this is fixed before final release :)
Anyone found alternative solutions? The last one pegs CPU (infinite loop of layoutSubviews
re-triggering)
What exactly are you doing with them for it to kill the CPU? It all seems to kinda just work in iOS 9 from what I've seen
Sent from my iPhone
On 1 Nov 2015, at 03:58, Alex Ehlke notifications@github.com wrote:
Anyone found alternative solutions? The last one pegs CPU (infinite loop of layoutSubviews re-triggering)
— Reply to this email directly or view it on GitHub.
Have you had any luck with implementing a UIStackView with a label in it with a dynamic height? I'm trying to reimplement UIAlertController as a UIStackView exercise. This is tripping me up.