Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16005] Android: Small device textfield issue in landscape mode

GitHub Issuen/a
TypeNew Feature
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-03-09T02:24:11.000+0000
Affected Version/sRelease 3.1.3
Fix Version/sRelease 6.1.0
ComponentsAndroid
Labelsandroid, community, notable
ReporterJignesh Kasundra
AssigneeFrankie Merzadyan
Created2013-09-20T11:20:18.000+0000
Updated2017-05-22T12:59:03.000+0000

Description

in small android device > landscap mode > when we enter the focus in to textfied the area is get expanded to full screen --------------------------------- how to prevent this behavior?

Comments

  1. Motiur Rahman 2013-09-21

    Hi Jignesh Kasundra, Could you share some test case.I think your textfield height is not set properly as a result you face this problem. Thanks
  2. Motiur Rahman 2013-09-22

    Hi Jignesh Kasundra, I have tested this in small device in landscape mode it works well. Here is the code so lets try it
       var win = Ti.UI.createWindow({backgroundColor: 'white',
       layout:'vertical'
       });
       
       
       // Create a TextField.
       var aTextField = Ti.UI.createTextField({
       	height :  Titanium.UI.SIZE,
       	top : 10,
       	width : Titanium.UI.FILL,
       	hintText : 'This is hint text',
       	softKeyboardOnFocus : Ti.UI.Android.SOFT_KEYBOARD_DEFAULT_ON_FOCUS, // Android only
       	keyboardType : Ti.UI.KEYBOARD_DEFAULT,
       	returnKeyType : Ti.UI.RETURNKEY_DEFAULT,
       	borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED
       });
       
       // Listen for return events.
       aTextField.addEventListener('return', function(e) {
       	aTextField.blur();
       	alert('Input was: ' + aTextField.value);
       });
       
       // Add to the parent view.
       win.add(aTextField);
       
       
       // Create a TextField.
       var aTextField1 = Ti.UI.createTextField({
       	height :  Titanium.UI.SIZE,
       	top : 10,
       	width : Titanium.UI.FILL,
       	hintText : 'This is hint text',
       	softKeyboardOnFocus : Ti.UI.Android.SOFT_KEYBOARD_DEFAULT_ON_FOCUS, // Android only
       	keyboardType : Ti.UI.KEYBOARD_DEFAULT,
       	returnKeyType : Ti.UI.RETURNKEY_DEFAULT,
       	borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED
       });
       
       // Listen for return events.
       aTextField1.addEventListener('return', function(e) {
       	aTextField1.blur();
       	alert('Input was: ' + aTextField1.value);
       });
       
       // Add to the parent view.
       win.add(aTextField1);
       win.open();
       
       
       
       
       
       
    Thanks
  3. Jignesh Kasundra 2013-09-27

    Hi.... Motiur Rahman this solution is not working for me when i test one titanium android emulator landscape mode or also on small device.... my problem is just like --------> http://developer.appcelerator.com/question/145494/disable-fullscreen-textareakeyboard-while-landscape-in-android Note:- ------------- we can set this behavior in navite android app. http://developer.android.com/guide/topics/ui/controls/text.html but how with titanium?
  4. Jignesh Kasundra 2013-09-30

    Hi.... Motiur do you checked above stuff ...?
  5. Ritu Agrawal 2013-12-17

    Reopening and moving this ticket to TIMOB as an enhancement request. Android provides a way to override the default behavior by way of android:imeOptions attribute that we may want to consider exposing in Titanium SDK. http://developer.android.com/guide/topics/ui/controls/text.html Section: Adding Other Keyboard Flags Related Q&A threads: https://developer.appcelerator.com/question/145497/how-to-set-androidimeoptions-property http://developer.appcelerator.com/question/145494/disable-fullscreen-textareakeyboard-while-landscape-in-android
  6. Michael Gangolf 2017-01-24

    Test code:
       var win = Ti.UI.createWindow({
           layout: "vertical",
           backgroundColor: '#fff'
       });
       
       // ---------------------  textfields
       var tf1 = Ti.UI.createTextField({
           value: "default",
           left: 10,
           right: 10,
           color: "#000",
           borderWidth: 1,
           borderColor: "#000",
           bottom: 10
       })
       var tf2 = Ti.UI.createTextField({
           value: "no fullscreen",
           left: 10,
           right: 10,
           fullscreen: false,
           color: "#000",
           borderWidth: 1,
           borderColor: "#000",
           bottom: 10
       })
       var tf3 = Ti.UI.createTextField({
           value: "fullscreen",
           left: 10,
           right: 10,
           fullscreen: true,
           color: "#000",
           borderWidth: 1,
           borderColor: "#000"
       });
       // ---------------------  Textarea
       var ta1 = Ti.UI.createTextArea({
           value: "default",
           left: 10,
           right: 10,
           height: 40,
           color: "#000",
           borderWidth: 1,
           borderColor: "#000",
           bottom: 10
       });
       var ta2 = Ti.UI.createTextArea({
           value: "no fullscreen",
           left: 10,
           right: 10,
           height: 40,
           color: "#000",
           borderWidth: 1,
           borderColor: "#000",
           bottom: 10
       });
       var ta3 = Ti.UI.createTextArea({
           value: "fullscreen",
           left: 10,
           right: 10,
           height: 40,
           color: "#000",
           borderWidth: 1,
           borderColor: "#000",
           bottom: 10
       });
       
       // test methods
       console.log(tf1.getFullscreen());
       console.log(tf2.fullscreen);
       console.log(tf3.fullscreen);
       ta2.fullscreen = false;
       ta3.setFullscreen(true);
       
       win.add(tf1);
       win.add(tf2);
       win.add(tf3);
       win.add(ta1);
       win.add(ta2);
       win.add(ta3);
       win.open();
       
       
    Demo gif: !http://migaweb.de/key.gif! PR: https://github.com/appcelerator/titanium_mobile/pull/8785
  7. Hans Knöchel 2017-01-24

    Thanks [~michael]! :-) Scheduling for 6.2.0 for now, depending on the progress we made for 6.1.0 the next weeks.
  8. Hans Knöchel 2017-04-25

    [~michael] Could you create a 6_1_X backport for this? The team wants to include it into 6.1.0 as well. We'd do it otherwise, no problem! Thanks!
  9. Michael Gangolf 2017-04-25

    [~hansknoechel] it looks like that is already in 6_1_X :-)
  10. Hans Knöchel 2017-04-25

    Whoops, you're right!
  11. Lokesh Choudhary 2017-05-08

    Verified the fix in 6.1.0.v20170508081747. Studio Ver: 4.9.0.201704240654 SDK Ver: 6.1.0.v20170508081747 OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.2 Appc NPM: 4.2.9 Appc CLI: 6.2.0 Ti CLI Ver: 5.0.12 Alloy Ver: 1.9.11 Node Ver: 6.10.1 Java Ver: 1.8.0_101 Devices: > google Nexus 6 --- Android 6.0.1 > google Nexus 6P --- Android 7.1.1
  12. Carlos Henrique Zinato 2017-05-22

    Amazinggg!!!!! Thanks for this

JSON Source