English 中文(简体)
在关键板出现时防止用户界面的移动
原标题:Prevent movement of user interface when keyboard appears

Im在用户界面使用Sencha Touch 2的微薄镜上工作。 我现在就在我的iPad和Pipe的Sari。

我的问题是,每当我利用一个文本领域时,Sato就把虚拟键盘上,并在屏幕上把整个网络观点推向上。

这只字眼很自然,因为顶托维亚再看不见。

Here are two screenshots which demonstrate the problem. In the second screenshot you can see the effect when the keyboard is visible.

是否有办法防止这种行为,有Sato resize 而是用户接口?

https://i.stack.imgur.com/H0z56.png” alt=“Normal view”/>


“Key板”/

问题回答

Unfortunately, Apple wants this behavior, but someone suggested a little hack using window.scrollTo():

listeners: {
    focus: function() {
        window.scrollTo(0,0);
    }
}

在发射功能中将这一守则强加于我:

 if (Ext.os.is.Android) {
        Ext.Viewport.on( painted , function () {
            Ext.Viewport.setHeight(window.innerHeight);
        });
    }

    if (Ext.os.is.iOS) {

        Ext.Viewport.on( painted , function () {
            Ext.Viewport.setHeight(window.innerHeight);
        });
    }

I have found a solution that works for me. You move the topbar into the container.

xtype:  container ,
                docked:  top ,
                height:  100% ,
                html:   ,
                itemId:  MyContainer ,
                width:  100% ,
                items: [
                    {
                        xtype:  titlebar ,
                        docked:  top ,
                        itemId:  topBar ,
                        title:  Obec Webchat ,
                        layout: {
                            type:  hbox ,
                            align:  start 
                        },
                        items: [
                            {
                                xtype:  button ,
                                action:  back ,
                                id:  BackButton ,
                                itemId:  BackButton ,
                                margin:  5 70% 5 15 ,
                                ui:  back ,
                                text:  Home 
                            }
                        ]
                    },
                    {
                        xtype:  container ,
                        docked:  bottom ,
                        height:  95% ,
                        html:  <iframe src="http://webim.obec.local/" width="100%" height="100%" scrolling="yes"></iframe> ,
                        itemId:  MyContainer1 ,
                        width:  100% 
                    }
                ]
            }

希望这一帮助。

您需要将<代码>blur(>)方法称作textfield

// Assuming the id of textfield - "textFieldId"
Ext.getCmp( textFieldId ).blur();

尝试<代码> 模糊外地的投入重点。

如果你把“html”用于Sencha分子,就必须去除tag门。 也可以将标题
列入源代码html。 我希望能帮助你:





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签