My input text is cut off halfway on some Android devices!! PLS HELP!

It appears almost exactly the same on a Galaxy Note 2 (orange instead of blue). I don’t mind that it’s “broken”, I mind that there’s no best practice/workaround but rather a gamut of choices, some of which are of wildly varying quality and compatibility with current releases. =/

So the issue of the strange colored boxes is that the Native device is trying to highlight the input field with a font that is larger than the field will allow (larger meaning needs a higher pixel height). The native OS doesn’t apply the same scaling as Corona, so 12pt to the system is different than 12pt in corona, scaled. If you increase the height of the input field…a lot, like 120 and or decrease the fontsize of your input field, you will find a happy medium. Using a custom font that looks good small (get it down to 9pt and see what I mean) and you can probably get away without the field changing size at all or not enough to notice.

Is there a work around for this, other then making the input boxes real big or the font real small?

I branch my logic so if it’s in a simulator it looks/acts one way and in a phone, another. Making the font really small is a matter of perspective. In my phone it looks decent so I don’t really care what font I need to assign, as a value, to make that happen.

So the issue of the strange colored boxes is that the Native device is trying to highlight the input field with a font that is larger than the field will allow (larger meaning needs a higher pixel height). The native OS doesn’t apply the same scaling as Corona, so 12pt to the system is different than 12pt in corona, scaled. If you increase the height of the input field…a lot, like 120 and or decrease the fontsize of your input field, you will find a happy medium. Using a custom font that looks good small (get it down to 9pt and see what I mean) and you can probably get away without the field changing size at all or not enough to notice.

Is there a work around for this, other then making the input boxes real big or the font real small?

I branch my logic so if it’s in a simulator it looks/acts one way and in a phone, another. Making the font really small is a matter of perspective. In my phone it looks decent so I don’t really care what font I need to assign, as a value, to make that happen.

Are the Corona devs working on a fix? Is there at least a best practice solution for this? My company is making business apps with Corona pro and I’ve found myself having to hack together work arounds or write custom code to make things work on different devices. It’s frustrating when the SDK you’re using doesn’t have solutions for common multi-device problems and you can’t get down into the SDKs native code to fix the issue yourself :confused:

To be fair, Corona does a lot of things very well and I will continue to use it. The shortcomings are becoming a bit maddening though.

Edit: For clarification, the issue we’re seeing is that the top half of the text gets cut off. However, the vertical area of the textbox is large enough to fit the text in. Problem is that the bottom of the text lines up with the middle of the textbox and the top of the text gets cut off before the top of the textbox area. So you end up with white space above and below the cut off text. We’re using the default font now, still broken.

If working with native textboxes are so difficult, why not create a Corona text input object with cursor and selectable text that we can use for all devices?

Do you have the same problem if you use native.systemFont?

Can you guys post some screen shots?

We were using native font. Though I believe that the device we were testing on had an older version of Android installed because I tried taking a screenshot with power button + volume up and it wouldn’t work. We were, however, able to solve the issue by making the textboxes twice as tall as they needed to be. Since we hid the background, this solution didn’t look bad… was just odd that we had to do so.

My happy sizes on my samsung galaxy note 2 are

84 height native textField and Courier New @ 16pt

72 height native textField and Courier New @ 9pt

Are the Corona devs working on a fix? Is there at least a best practice solution for this? My company is making business apps with Corona pro and I’ve found myself having to hack together work arounds or write custom code to make things work on different devices. It’s frustrating when the SDK you’re using doesn’t have solutions for common multi-device problems and you can’t get down into the SDKs native code to fix the issue yourself :confused:

To be fair, Corona does a lot of things very well and I will continue to use it. The shortcomings are becoming a bit maddening though.

Edit: For clarification, the issue we’re seeing is that the top half of the text gets cut off. However, the vertical area of the textbox is large enough to fit the text in. Problem is that the bottom of the text lines up with the middle of the textbox and the top of the text gets cut off before the top of the textbox area. So you end up with white space above and below the cut off text. We’re using the default font now, still broken.

If working with native textboxes are so difficult, why not create a Corona text input object with cursor and selectable text that we can use for all devices?

Do you have the same problem if you use native.systemFont?

Can you guys post some screen shots?

We were using native font. Though I believe that the device we were testing on had an older version of Android installed because I tried taking a screenshot with power button + volume up and it wouldn’t work. We were, however, able to solve the issue by making the textboxes twice as tall as they needed to be. Since we hid the background, this solution didn’t look bad… was just odd that we had to do so.

My happy sizes on my samsung galaxy note 2 are

84 height native textField and Courier New @ 16pt

72 height native textField and Courier New @ 9pt

I have the exact same issue on Android handsets. Here is how I fixed the problem.

if (system.getInfo(“platformName”) == “Android”) then

  local userIdInput = native.newTextField(5, 5, 150, 40) 

  userIdInput.font = native.newFont(native.systemFont, 14)    

  userIdInput.size = 14

else

  – create a similar set of specs for iOS devices

end

The key is the specification for the “size” field, and make sure that it matches with the “font” field. You can play with different height specifications/combinations inside the newTextField() function and size specifications in the “font” & “size” fields to get the optimum effect you desired. This technique should work for both systemFont and other fonts. 

@Rob sir here is my screenshot:

Please help us find some workaround for this! thanks

what is your config.lua like? 

What device are you running on? 

Can you post your code that creates your native.newTextField?