2

我对 Jellybean 键盘有一个奇怪的问题。当我的用户升级他们的操作系统时,只要他们尝试使用键盘输入数据,它就不会输入。时期。

这很奇怪,因为您确实可以专注于文本区域,但是在键盘上输入却没有输出。

有人知道修复吗?更具体地说,我的平台是 PhoneGap 1.9.0,我在项目中没有任何其他原始 java 文件,我的应用程序清单如下:

<application
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:configChanges="orientation|keyboardHidden|screenSize">
        <activity
            android:name=".App"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

我的 onCreate 非常简单,如下所示:

public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      super.setIntegerProperty("loadUrlTimeoutValue", 60000);
      super.loadUrl("file:///android_asset/www/index.html");
      this.appView.setInitialScale(100);
    }

这是 Sencha Touch 2 生成的表单的来源:

config: {
        padding: 20,
        items: [
        {
            xtype: 'image',
            src: 'resources/img/logo-splash.png',
            width:250,
            height: 229,
            baseCls: 'login-splash'
        },
        {
            xtype: 'fieldset',
            defaults: {  
                required: true,  
                labelAlign: 'left',  
                labelWidth: '35%'  
            },  
            items: [  
            {  
                xtype: 'emailfield',  
                name : 'email',  
                label: 'Email',  
                clearIcon: true  
            }, {  
                xtype: 'passwordfield',  
                name : 'password',  
                label: 'Password',  
                clearIcon: true  
            }],

        }, 
        {
            xtype: 'button',
            text: 'Login',
            ui: 'action',
            id: 'loginBtn',
            baseCls: 'btn-orange ui-rd'
        }
        ]
    },

然后是 Sencha 的最终 HTML 输出(在 webkit 浏览器上查看):

<div class="x-inner x-form-fieldset-inner" id="ext-element-129"><div class="x-container x-field-text x-field x-label-align-left x-field-required x-field-labeled x-form-label-nowrap x-empty" id="ext-emailfield-1"><div class="x-form-label" id="ext-element-131" style="width: 35% !important; "><span id="ext-element-132">Email</span></div><div class="x-component-outer" id="ext-element-130"><div id="ext-input-1" class="x-field-input"><input id="ext-element-133" class="x-input-el x-form-field x-input-email" type="email" autocapitalize="off" name="email"><div class="x-clear-icon" id="ext-element-135"></div><div class="x-field-mask" id="ext-element-134"></div></div></div></div><div class="x-container x-field-text x-field x-label-align-left x-field-required x-field-labeled x-form-label-nowrap x-empty" id="ext-passwordfield-1"><div class="x-form-label" id="ext-element-137" style="width: 35% !important; "><span id="ext-element-138">Password</span></div><div class="x-component-outer" id="ext-element-136"><div class="x-field-input" id="ext-input-2"><input class="x-input-el x-form-field x-input-password" type="password" id="ext-element-139" autocapitalize="off" name="password"><div class="x-clear-icon" id="ext-element-141"></div><div class="x-field-mask" id="ext-element-140"></div></div></div></div></div>

谢谢!

澄清一下:问题是当字段聚焦时,键盘会弹出,但是当你按下键时它不会填充文本

4

1 回答 1

1

I was able to resolve the issue by upgrading PhoneGap from 1.9.0 to 2.0.0.

I am not sure what was the exact cause, but I also made a post to the community here: http://community.phonegap.com/nitobi/topics/blank_keyboard_input_on_android_jellybean

My instinct is that it was related to a way Cordova was handling Javascript events and keyboard events. But nonetheless it's working now.

于 2012-09-05T02:47:36.787 回答