【问题标题】:Keyboard hide not working on click键盘隐藏在点击时不起作用
【发布时间】:2013-10-23 13:52:21
【问题描述】:

在我的应用程序中,当我单击键盘显示的文本字段时,在文本字段旁边有一个按钮。点击按钮显示操作表但键盘没有隐藏,操作表显示在键盘后面

这里是actionsheet的代码

   if (bval == "productpic") {
                if (!this.actions) {
                    this.actions = Ext.Viewport.add({
                        xtype: 'actionsheet',
                        style: 'background:#f3f3f3;',
                        items: [{
                            xtype: 'button',
                            ui: 'normal',
                            text: 'Take Photo',
                            scope: this,
                            handler: function () {
                                this.actions.hide();
                                capturePhoto();
                            }
                        }, {
                            xtype: 'button',
                            ui: 'normal',
                            text: 'Choose Existing Photo',
                            scope: this,
                            handler: function () {
                                this.actions.hide();
                                getPhoto(pictureSource.PHOTOLIBRARY);
                            }
                        }, {
                            xtype: 'button',
                            ui: 'decline',
                            text: 'Cancel',
                            scope: this,
                            handler: function () {
                                this.actions.hide();
                            }
                        }]
                    });
                }

清单详情

android:hardwareAccelerated="true"
android:versionCode="1"
android:versionName="1.0"
android:windowSoftInputMode="stateAlwaysHidden" >

如何在基于 phonegap 的 Android 应用程序中隐藏按键时的键盘?请帮帮我

【问题讨论】:

    标签: android extjs cordova sencha-touch-2


    【解决方案1】:

    在onCLick()事件中,放

    InputMethodManager imm = (InputMethodManager)getSystemService( Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);

    myEditText 是导致键盘显示的文本字段

    Source

    【讨论】:

    • 它不是基于本机的应用程序。它使用了 javascript
    猜你喜欢
    • 2018-03-19
    • 1970-01-01
    • 2011-02-17
    • 2011-03-30
    • 1970-01-01
    • 2012-02-02
    • 1970-01-01
    • 2011-12-17
    相关资源
    最近更新 更多