I'm setting up a WKInterfaceController like this:
(read RTC as Relative to Container, AL as alignment and STF as size to fit content)
- Main Group: w: RTC (1) h: RTC (1) - AL h: Center v: Top
- WKInterfaceImage w: 30 h: 30 - AL h: Center v: Top
- Mid Group: w: RTC (1) h: RTC (0.5) - AL h: Center v: Center
- WKInterfaceLabel: w: RTC (1) h: RTC (0.5) - AL h: Center v: Center
- Bottom Group: w RTC (1) h: STC - AL h: Center v: Bottom
- other stuff...
a representation looks like this:
I want the font of the label contained in the Mid Group to shrink if the text is too big to stay inside it (it's ok if it goes multiple lines).
To achieve this I've set the font to be system bold 30, the Min Scale
value to be 0.5, and the Lines
value to be 0, but everything gets ignored and the text gets trunkated or (depending on the configuration of the container / label) it goes outside the group boundaries.
What am I missing? I've tried to follow the answer contained in this question but didn't manage to make it work properly.
Ok, I've received a followup on my bug report, apparently the Min Scale flag only applies for labels that are precisely of one line.
Hi Marco,
This is a follow-up regarding Bug ID# 22774281.
Please update your report directly at http://bugreport.apple.com for the fastest response. Please do not email your updates.
Engineering has determined that this issue behaves as intended based on the following information:
This is a known behavior of UILabel. If you request multiple lines, you will truncate. We don’t scale to just fit multiple lines, only one.
The other answer (minScale only works when labels contain precisely one line) is correct.
In my experiments I see a second limitation:
minScale also doesn't work when used inside a horizontal group
horizontal group
label using minScale
label using minScale
(also filing a bug report)
watchOS 2.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With