![](/img/trans.png)
[英]Sencha Touch do not set scale and allow scrolling and resize on iPhone or iPad
[英]Sencha Touch - iframe scrolling in iPhone
在我的一种观点中,我有一个显示iframe的Ext.Component。 定义如下:
Ext.define('MyApp.view.MyView',扩展为:'Ext.Component',
alias: 'widget.myview',
id: 'myView',
config: {
style: '-webkit-overflow-scrolling: touch; height: 100%; overflow: auto;',
href: false
},
template: [
{
reference: 'iframeElement',
tag: 'iframe',
style: 'height: 100%; width: 100%; border: 0;'
}
],
updateHref: function(href){
this.iframeElement.set({ src: href });
}
});
渲染组件时,我使用updateHref('http://');加载iframe内容。
问题是,在iPhone上,当我向下滚动iframe内容并结束滚动时,文档会自动向上滚动回到开头。
我该如何解决?
好的,我找到了解决此问题的方法。
解决方案是将iframe的高度设置为较高的值,例如2000px。 然后,如果您从顶部滚动不到2000像素,内容将不会跳回到开头。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.