[TIMOB-690] add support for adjustsFontSizeToFitWidth to text field
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:53:56.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.3.0 |
Components | iOS |
Labels | n/a |
Reporter | Nolan Wright |
Assignee | Blain Hamon |
Created | 2011-04-15T02:34:33.000+0000 |
Updated | 2011-04-17T01:53:56.000+0000 |
Description
i wonder if this is really just fontSize:'auto' for us on the JS API side
from premium support ticket
http://helpdesk.appcelerator.net/tickets/1743">http://helpdesk.appcelerator.net/tickets/1743
Will implement as 'fontSize:auto' but this could be misleading under some circumstances (for example, I have no idea if table row views would resize their fonts).
Actually, brief correction. Because fonts should always have a default size (in order to calculate the bounding box/truncation/etc.) this will be implemented on a font object as an 'allowsResizing' property.
Another alternative is to use a 'defaultSize' parameter and have 'fontSize' be 'auto'.
(from [8038bc589a4158e7be132efccdc6e7d8f8155621]) Closes #690: TiUILabel and TiUITextField now support 'minimumFontSize'. See ticket for caveats. http://github.com/appcelerator/titanium_mobile/commit/8038bc589a4158e7be132efccdc6e7d8f8155621"> http://github.com/appcelerator/titanium_mobile/commit/8038bc589a415...
As always, caveats...
Setting minimumFontSize: on a label forces it to fill exactly one line. This is due to a bug in Apple's UILabel code; we can do nothing about it. So it's recommended that this be used judiciously.
Setting minimumFontSize: and then revoking it by setting minimumFontSize = 0 does NOT automagically resize text to its initial size. The font size may, however, be reset by the user. We don't do this for them since it should be assumed that if text was autoadjusted to fit in its bounds, they don't want to size it larger so it suddenly goes out of them again.