Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-24865

Android: Label width won't auto-size larger after font has been downscaled

    Details

    • Type: Bug
    • Status: Open
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: Release 6.1.1, Release 8.0.0
    • Fix Version/s: None
    • Component/s: Android

      Description

      Summary:
      If a label is set up with width "Ti.UI.SIZE" and is using "minimumFontSize" to auto-downscale the font, then the font will never increase in size (up to the default font size) when the parent view's width increases.

      Steps to reproduce:

      1. Build the below code for Android.
      2. Launch the app in landscape mode.
      3. Rotate the device to portrait.
      4. Notice that the label's font has been downscaled to fit. (This is correct behavior.)
      5. Rotate the device back to landscape.
      6. Notice that the label's font size has not increase in size to fit the screen. (This is a bug.)

      var window = Ti.UI.createWindow({ backgroundColor: "gray" });
      window.add(Ti.UI.createLabel(
      {
      	text: "Hello World!",
      	color: "white",
      	backgroundColor: "black",
      	font: { fontSize: 200 },
      	minimumFontSize: 10,
      	width: Ti.UI.SIZE,
      }));
      window.open();
      

      Expected Result:
      Label should auto-scale the font up to the default font size (the maximum) every time the parent's width has changed when the label is set up for "Ti.UI.SIZE".

      Work-around:
      Setting the Label width to "100%" will auto-scale the font correctly when the parent width increases/decreases in size.

        Attachments

          Activity

            People

            • Assignee:
              jquick Joshua Quick
              Reporter:
              jquick Joshua Quick
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-10811
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration