newTextField Font Size on Android Tablet

Hello,

I am having a bit of trouble with newTextField Font sizes. I have several newTextField in my app, and after looking at the Native Keyboard example, I thought I had them working fine.

I set the font size dynamically depending on the result from
[lua]system.getInfo(“platformName”)[/lua]
as in the example.

This works great on phones, but not when my app or the Native Keyboard example is installed on an Android tablet. The font size of the newTextField is far too small. All of the objects on the screen are expanded to fit the tablet beautifully, but when the user types anything into the newTextBox it is barely readable.

I thought that I could work out the width of the screen and scale the font size dynamically, so I tried using
[lua]local inputFontSize = math.floor(display.contentWidth / 17)[/lua]
but this does not work - and I subsequently discovered that display.contentWidth is always returning 320 regardless of the device the app is installed onto.

Does anyone have any ideas how I can fix this??

tia [import]uid: 74250 topic_id: 16466 reply_id: 316466[/import]

I came up with a solution to this after reading through the forums…

I now look at the value returned by

[lua]display.contentScaleX[/lua]

and now use this to set the font size.
Just thought I’d share it here for anyone else looking too. [import]uid: 74250 topic_id: 16466 reply_id: 62944[/import]