簡體   English   中英

當文本字段聚焦時,Sencha Touch 2 Carousel縮小

[英]Sencha Touch 2 Carousel shrinks when textfield is focused

我正在使用Ext.Carousel包裹3個面板用於我的應用程序。 在某個時候,當用戶單擊按鈕時,我需要一組字段才能在疊加層中彈出。

當前,當用戶將焦點放在這些文本字段之一上時,輪播(現在位於背景中)會縮小到坐在android鍵盤上方,這使得該浮動文本字段后面的所有內容都看起來像垃圾。 這是示例代碼:

Ext.Viewport.add(Ext.create('Ext.Carousel', {
    fullscreen: true,
    items: [
        {
            xtype: 'panel',
            items: [
                {
                    xtype: 'button',
                    handler: function() {
                        entryField = Ext.create('Ext.Panel', {
                            hidden: true,
                            modal: true,
                            floating: true,
                            width: '100%',
                            height: 'auto',
                            items: [
                                {
                                    xtype: 'textfield'
                                }
                            ]
                        });
                        entryField.showBy(this);
                    }
                }
            ]
        },

        {
            xtype: 'panel'
        },

        {
            xtype: 'panel'
        }
    ]
}));

解決了:

拔起鍵盤時,視口實際上會縮小。 要解決此問題,只需將視口高度設置為初始化應用程序時的屏幕高度。 這樣,當鍵盤出現時,它將保持此高度而不是彎曲。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM