Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/425.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
Javascript Sencha触摸屏有时太小_Javascript_Sencha Touch_Extjs - Fatal编程技术网

Javascript Sencha触摸屏有时太小

Javascript Sencha触摸屏有时太小,javascript,sencha-touch,extjs,Javascript,Sencha Touch,Extjs,Chrome的开发者工具显示了为我的面板生成的html: <div id="ext-comp-1027" class=" x-panel" style="width: 1600px; height: 205px; "> <div class="x-panel-body x-html" id="ext-gen1098" style="left: 0px; top: 0px; "> <div class="product">

Chrome的开发者工具显示了为我的面板生成的html:

<div id="ext-comp-1027" class=" x-panel" style="width: 1600px; height: 205px; ">
    <div class="x-panel-body x-html" id="ext-gen1098" style="left: 0px; top: 0px; ">
        <div class="product">
            <div class="title">*snip*</div>
            <img src="*snip*">
            <div class="info">*snip*</div>
        </div>
    </div>
</div>
高度是硬编码的,但有时,我只能在第一次显示面板时才知道,高度值太小,内容被隐藏。如果我删除Chrome中的height属性,它可以正常工作

问题是,面板每次都会重新生成,因为它位于getDetailCard()函数中


如何防止这种情况发生?

我遇到了同样的问题,我要做的是添加一个调用以下函数的
afterlayout
侦听器:

    app.getHeight = function(){
         return Ext.Element.getViewportHeight() - Ext.getCmp('viewport').tabBar.getHeight();
    }

在我的情况下,底部有一个选项卡栏。如果没有,只需将其设置为
Ext.Element.getViewportHeight()

,这可能不适合我的情况,但应该可以帮助其他人
    app.getHeight = function(){
         return Ext.Element.getViewportHeight() - Ext.getCmp('viewport').tabBar.getHeight();
    }