Problem
Mobileweb does not translate string values for
fontSize
into the appropriate integer values. Android and iOS do this automatically. This likely impacts other properties, but this is how it surfaced for me.
Test Case
var win = Ti.UI.createWindow();
win.add(Ti.UI.createLabel({
text: 'Hello, World!',
font: {
fontSize: '32' // Will automatically become an integer on android and ios, does not on mobileweb
}
}));
win.open();
The result on Android and iOS will be a label with a font size of 32. On mobileweb, I'm guessing it doesn't recognize the string value and then just uses the default font size to display the label. Changing
'32'
to simply
32
allows mobileweb to resize correctly.
Pull Request: https://github.com/appcelerator/titanium_mobile/pull/2327 Note: make sure to set a background color on the window when running the above test case, otherwise you just get a black screen and can't see the text.
Tested On: Titanium studio : 2.1.1.201207271312 SDK version : 2.2.0.v20120807070117 Android 4.0.4 - default ,chrome 18.0 Iphone 4.3.5 - safari mobile Mountain lion(10.8) - chrome 21.0,safari 5.1.4,firefox 14.0.1