Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

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

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 6.1.1, Release 8.0.0
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, engSchedule, label
ReporterJoshua Quick
AssigneeJoshua Quick
Created2017-06-20T19:16:53.000+0000
Updated2019-06-18T23:31:35.000+0000

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:*

Build the below code for Android.

Launch the app in landscape mode.

Rotate the device to portrait.

Notice that the label's font has been downscaled to fit. (This is correct behavior.)

Rotate the device back to landscape.

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.

Comments

  1. Joshua Quick 2019-05-14

    I have confirmed that this issue still happens with Titanium 8.0.0 on Android 9.0.

JSON Source