Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does WKInterfaceLabel Min Scale work? It gets ignored once set values

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:

label interface

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.

like image 761
dev_mush Avatar asked Sep 20 '15 16:09

dev_mush


2 Answers

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.

like image 128
dev_mush Avatar answered Nov 09 '22 22:11

dev_mush


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

like image 22
Gerd Castan Avatar answered Nov 09 '22 22:11

Gerd Castan