Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23491] Keyboard Layout Issue in iPad Pro

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionNot Our Bug
Resolution Date2016-08-09T10:36:32.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
LabelsTextField, iOS, iPadPro
ReporterNaga harish M
AssigneeAngel Petkov
Created2016-06-10T05:00:09.000+0000
Updated2016-08-09T10:36:32.000+0000

Description

Hi, We are facing a problem with TextField with latest Ti SDK(5.2.2 GA) and iPad Pro device. I did not try with other versions Here is code
<Alloy>
<Window class="container">
<View width="Ti.UI.FILL" height="Ti.UI.FILL">
<View id="okCancelView">
<TextField id="txtField"/>
</View>
</View>
</Window>
</Alloy>
".container": {
	backgroundColor:"#FFF"
}
"#okCancelView":{
	width:500,
	height:40,
	top: 68
}
"#txtField":{
	width: 500,
	height:50,
	borderColor:"#CCC",
	borderWidth:2
}
We are getting onscreen keyboard, like this with above code in iPad pro !http://i.stack.imgur.com/TS1Jh.png! But if I create sample app in Xcode with textField, We are getting like this. !http://i.stack.imgur.com/Py9ai.png! How to get default keyboard layout, same as XCode in Titanium.

Attachments

FileDateSize
protest.zip2016-07-20T17:29:11.000+000024620

Comments

  1. Naga harish M 2016-06-20

    same result using 5.3.0 SDK
  2. Angel Petkov 2016-07-14

    Hi [~nagaharish] using 5.4.0 with the below demo-code should fix the issue. The reason the keyboard looks different initially is because a different constant gets set on the SDK compared to Xcode. Which I find interesting as it means the keyboard displayed by default in Xcode is UIKeyboardTypeASCIICapable instead of UIKeyboardTypeDefault. Demo Code:
       var win = Ti.UI.createWindow({
       
         backgroundColor: 'white'
       });
       
       var textField = Ti.UI.createTextField({
         borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
         keyboardType:Titanium.UI.KEYBOARD_TYPE_ASCII,
         color: '#336699',
         top: 10, left: 10,
         width: 250, height: 60
       });
       
       win.add(textField);
       win.open();
       
  3. Naga harish M 2016-07-15

    Thank you @Angel Petkov, But may I know when we can get proper fix for it. Because adding
       keyboardType:Titanium.UI.KEYBOARD_TYPE_ASCII,
       
    manual bit hard for me.
  4. Hans Knöchel 2016-07-20

    Just tested with latest Xcode and it behaves exactly as we do (since we don't set anything internal as well that could override it). See the attached Xcode project. To note: 9.7" acts the same as we do, the 12.9" acts differently. *EDIT*: You very possibly selected the wrong iPad Pro simulator during your comparisons. Just tested the following code using an 12.9" simulator in Titanium ([Screen](https://abload.de/img/simulatorscreenshot20mxko6.png)):
       
       var win = Ti.UI.createWindow({backgroundColor: 'white'});
       
       win.add(Ti.UI.createTextField({width: 200, height: 50, backgroundColor: "gray"}));
       win.open();
       
    Please confirm, thanks!
  5. Naga harish M 2016-07-21

    May be I am selecting wrong simulator. But I tested in really Device (iPad pro). Same issue is there in it also. Xcode it works fine. But Titanium code only keyboard is different.
  6. Angel Petkov 2016-07-26

    [~nagaharish] Hello, we can't push the fix you desire for two reasons. The first being it's easily fixed if using one of the constant since that's what they are for, otherwise we would have to implement a way of changing the constant depending on the device. Secondly, to achieve it would require applying some bad practices it would also mean that the constants would differ depending on the device as oppose to having one default constant. We would be introducing behavior different to the rest of our UI components. In conclusion to avoid the different appearance in the keyboard please set the appropriate constant.
  7. Naga harish M 2016-07-27

    @Angel Thank you, So I need to manual set this.Ok I will take care. Is above solution works fine with 5.3.0 or 5.3.1. In above comment ur saying 5.4.0 version, but for me last update was 5.3.1 GA.
  8. Angel Petkov 2016-07-27

    No problem! I was testing using 5.4.0, however it will work with both 5.3.0 or 5.3.1. Code strong!
  9. Naga harish M 2016-07-27

    @Angel I tried like this
       var textField = Ti.UI.createTextField({
         borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
         keyboardType:Titanium.UI.KEYBOARD_TYPE_ASCII,
         color: "#336699",
         top: 10,
         left: 10,
         width: 250, 
         height: 60
       });
       $.index.add(textField);
       $.index.open();
       
    I run in real device also still same issue. keyboard layout is not as expected. Tried in Ti SDK 5.3.0 and 5.3.1 With Xcode 7.3 Please help me.
  10. Angel Petkov 2016-07-28

    Just tested using the code above with 5.3.1 GA and 5.3.0, on simulator and device. What I'm seeing is the same keyboard layout as the image representing xcode posted above, the resulting [image](http://imgur.com/a/RwOd4). Can you please confirm if that is the same result ?
  11. Naga harish M 2016-08-09

    @Angle: In existing application after added below line. With out doing any change, in iPad pro I am getting the keyboard what we expected. same like this [http://imgur.com/a/RwOd4] Even I did not added "keyboardType:Titanium.UI.KEYBOARD_TYPE_ASCII" also.
        <enable-launch-screen-storyboard>true</enable-launch-screen-storyboard>  
        
    But my total UI is changed. If I added above line in iPad pro. Please suggest me how to fix this.
  12. Hans Knöchel 2016-08-09

    Oh, good catch! Yes, the iPad-pro handling is of course only enabled if you enable storyscreen-support and/or set the UIRequiresFullScreen value to true in your plist. If you remove that from native xcode-projects, you will have the same behavior as we have by default. Again: We do not intercept that behavior, it's a matter of configuration. Will close this ticket for now, thanks again!

JSON Source