سؤال

I have a multi-line Label, with user-defined text, that must fit inside some given dimensions.

<s:HGroup width="400" height="250">
  <s:Label id="myText" width="100%"/>
</s:HGroup>

I would like to adjust the font size of myText at runtime, depending on the content of myText.text. What is the best way to do this?

هل كانت مفيدة؟

المحلول

Unfortunately there is no API call or even a straightforward way of doing this. The only way to do this is to iterate over font sizes and check if the text fits within bounds.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top