Shrinking of text boxes in case of Mobile Web

You must Login before you can answer or comment on any questions.

Hi, I am new to Titanium. I am developing an application with a login screen at the start of the application that contains two labels and two text boxes to enter userID and password. Application is working fine. But when I test the application in smartphone browser I am getting an alignment issue in case of android mobile browser. That is when I tap on text field a keypad is rolling over the screen and textfields are getting shrinked that is the height of the textfields are decreasing and after the keypad rolls back the height of the text field is normal. This is happening in android browser. Can anyone share a solution ASAP for this.

Thanks in Advance...

2 Answers

When a Titanium Mobile Web app is loading we force the outermost container to 100% width and 100% height to fill the screen. When the app finishes loading, we override the 100% height with the actual height of the browser in pixels. This is to prevent the app from being squished on Android tablets when the keyboard opens.

If this is counter to what you're seeing, then there could be a bug. What device and Android version are you testing on? Is it possible to code up a small sample test that we could use to fix the issue?

— answered 8 months ago by Chris Barber
answer permalink
5 Comments
  • Hi Chris, I am not clear with your answer. Can you give any detail explanation or any sample code...

    — commented 8 months ago by Prasad M.R.C

  • What I'm trying to say in my answer is we knew of a bug with the app being vertically scaled when the keyboard was opened on certain Android tablets. Your problem sounded similar and I'm wondering what device you are seeing the problem on and if it's possible for you to supply us with a test case so we determine if it's a bug and if it is, fix the bug.

    — commented 8 months ago by Chris Barber

  • I am executing the application in an android emulator browser. Initially we mentioned some height for the text fields. When the textfield gets focus the keypad is rolled over and the height of the text field gets decreased and looks like shrinked. Is there any change to scroll up the window a bit more with out effecting the heights of textfields.

    var txt1 = Ti.UI.createTextField({ width : '90%', height : '10%', clearButtonMode : true, hintText : 'User ID', borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED, keyboardType : Ti.UI.KEYBOARD_EMAIL });

    var txt = Ti.UI.createTextField({ width : '90%', height : '10%', clearButtonMode : true, hintText : Password', borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED, keyboardType : Ti.UI.KEYBOARD_EMAIL });

    These are the textboxes I am using. The height should not get disturbed when text filed gets focus and keypad rolls over. Kindly share a solution ASAP...

    — commented 8 months ago by Prasad M.R.C

  • Show 2 more comments

Your Answer

Think you can help? Login to answer this question!