【问题标题】:When i touch textfield, keyboard appears but haven't focus and keyboard hide textfield当我触摸文本字段时,键盘出现但没有焦点并且键盘隐藏文本字段
【发布时间】:2014-03-20 11:40:13
【问题描述】:

当我触摸文本字段时,键盘出现但没有焦点并且键盘隐藏文本字段。

在 Android 中完美运行,但在 IOS 中我遇到了如图所示的问题

如果我触摸文本字段用户或通过键盘显示,但如果我写不起作用并且键盘隐藏所有视图。

如果箭头上的脉冲 (),视图向上滚动并聚焦在文本字段上,但我需要在第一时间使焦点和视图向上滚动。

我的代码:

Ext.define("com.app.Access", {
    extend: 'Ext.form.Panel',
    xtype: 'access',
    requires: ['Ext.form.FieldSet','Ext.form.Password'],

    config: {
        pack: 'center',
        style: 'background-color:#FFFFFF',
        scrollable: 'vertical',
        cls: 'Login',

        items: [
            {
                xtype: 'panel',

                styleHtmlContent: true,
                html: '<img class="img100" src="resources/images/image.jpg"/>',
            },
            {
                xtype: 'fieldset',
                title: 'Identification',
                styleHtmlContent: true,


                items: [
                    {
                        xtype: 'textfield',
                        name: 'user',
                        label: 'User',
                        labelWidth: '40%',
                        required: true
                    },
                    {
                        xtype: 'passwordfield',
                        name: 'password',
                        label: 'Pass',
                        labelWidth: '40%',
                        required: true
                    },
                    {
                        xtype: 'button',
                        itemId: 'accessButton',
                        ui: 'action',
                        text: 'Access'
                    }
                ]
            }
        ]
    }
});

有什么帮助吗??谢谢!!

【问题讨论】:

  • 我不使用 iOS 代码,我使用的是 cordova 和 phonegap

标签: ios cordova sencha-touch


【解决方案1】:

我在 iOS 上也遇到过这个问题。 我刚刚添加了 $('#myInput').focus() 作为解决方法。

【讨论】:

  • 非常感谢您的解决方案,那行写在哪里?
猜你喜欢
  • 1970-01-01
  • 2023-01-27
  • 1970-01-01
  • 2014-03-18
  • 2011-01-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-12-22
相关资源
最近更新 更多