[AC-5011] Android: Label with minimumFontSize set, fontSize increases when text too long.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Needs more info |
Resolution Date | 2017-06-21T19:58:59.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | android |
Reporter | Donald Anderson |
Assignee | Shak Hossain |
Created | 2017-06-06T09:47:41.000+0000 |
Updated | 2017-06-22T10:46:29.000+0000 |
Description
Using Titanium SDK 6.1.0.GA, when a label with a fixed height and width has a minimumFontSize set and text long enough to exceed with width of the label, the font size seems to increase.
[~donald.anderson] I tried to create a minimum reproducible test case for this but I'm unable to see the behaviour your describing. Here's my code, the minimumFontSize appears to be respected to me. Could you confirm whether I am attempting to reproduce the issue correctly?
Hello, can you share a full reproducible code?
var win = Ti.UI.createWindow({ title: 'Window', backgroundColor: '#fff' }); var view = Ti.UI.createView({}); var label = Ti.UI.createLabel({ text:"Revision: Seventeen", font: { fontSize: 13, fontFamily: "OpenSans" }, color: "#262626", height: 22, top: 50, left: 50, width: 90, height: 22, wordWrap: false, ellipsize: Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END, backgroundColor:"#bbb" }); var label2 = Ti.UI.createLabel({ text:"Revision: Seventeen", font: { fontSize: 13, fontFamily: "OpenSans" }, minimumFontSize: 13, color: "#262626", height: 22, top: 100, left: 50, width: 90, height: 22, wordWrap: false, ellipsize: Ti.UI.TEXT_ELLIPSIZE_TRUNCATE_END, backgroundColor:"#bbb" }); view.add(label); view.add(label2); win.add(view) win.open(); I'm adding two labels here, one with a minimum font size set and one without. If you run this on an iOS device you should see the first label ellipsizes before the end of the label, adding a minimum font size works around this. If you build this on android however you should see the font size of the second label has increased.