Reputation: 12218
I have 2 UILabel
side-by-side horizontally using auto-layout as following:
adjustsFontSizeToFitWidth = true
On launch everything is fine, when returning from landscape to portrait 1st-Label shrinks to zero width.
Constraints are following:
H:|-0-[1stLabel]
, V:[1stLabel]-0-|
H:[2ndLabel]-0-|
, V:[2ndLabel]-0-|
H:[1stLabel]-(>=1)-[2ndLabel]
Upvotes: 0
Views: 51
Reputation: 12218
I missed to set ContentCompressionResistancePriority on 2nd-Label:
secondLabel.setContentCompressionResistancePriority(.defaultLow, for:.horizontal)
Upvotes: 0