Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Meteor Cordova键盘秀活动中触发重画著名视图_Cordova_Meteor_Famo.us - Fatal编程技术网

在Meteor Cordova键盘秀活动中触发重画著名视图

在Meteor Cordova键盘秀活动中触发重画著名视图,cordova,meteor,famo.us,Cordova,Meteor,Famo.us,我使用渲染简单的页眉/正文/页脚布局: <template name="layout"> {{#famousContext id="mainCtx"}} {{#HeaderFooterLayout headerSize="100" footerSize="60"}} {{#Surface target="header" class="red-bg" translate="[0,0,100]"}} <div id="header">h

我使用渲染简单的页眉/正文/页脚布局:

<template name="layout">
  {{#famousContext id="mainCtx"}}
    {{#HeaderFooterLayout headerSize="100" footerSize="60"}}
      {{#Surface target="header" class="red-bg" translate="[0,0,100]"}}
        <div id="header">header</div>
      {{/Surface}}

      {{#RenderController target="content" transition="slideWindowRight"}}
        {{>yield}}
      {{/RenderController}}

      {{#Surface target="footer" class="red-bg" translate="[0,0,100]"}}
        <div id="footer">footer</div>
      {{/Surface}}
    {{/HeaderFooterLayout}}
  {{/famousContext}}
</template>

{{{#famousContext id=“mainCtx”}
{{{#HeaderFooterLayout headerSize=“100”footerSize=“60”}
{{{#Surface target=“header”class=“red bg”translate=“[0,0100]”}
标题
{{/表面}
{{{#RenderController target=“content”transition=“slidewindwright”}
{{>产量}
{{/RenderController}
{{{#Surface target=“footer”class=“red bg”translate=“[0,0100]”}
页脚
{{/表面}
{{/HeaderFooterLayout}
{{/famousContext}
正文包含一个输入字段:

<template name="home">
  {{#Surface class="green-bg"}}
    <h2>Home Page</h2>
    <input type="text" style="width:100%;line-height:40px;" placeholder="Type something">
  {{/Surface}}
</template>

{{{#Surface class=“green bg”}
主页
{{/表面}
在iOS 8上的Phonegap/Cordova上,当输入字段处于焦点时,会弹出一个键盘。所需的行为是,页脚随着键盘向上滑动,整个视图的大小也随之调整。默认情况下不会发生这种情况。相反,视图不会更改,键盘显示在页脚顶部


我可以收听
native.keyboardshow
native.keyboardhide
事件来检测键盘弹出。不会触发
window.onresize
事件,但
window.innerHeight
正在更改。我如何才能强制Famo.us视图重新绘制并适应新空间?(最好沿键盘运动平滑收缩)

如果您想收听
onresize
事件,请使用
resize
事件,如下所示:

var mainContext = Engine.createContext(document.getElementById('famousAppContent'));
mainContext.on('resize', function(e) {
    console.log('mainContext After resize=' + mainContext.getSize());
}.bind(this));

谢谢然而,问题是,当键盘打开时,应用程序上下文没有调整大小。我想,我需要手动操作。