我有一个Ionic应用程序,头部需要根据scrollTop调整大小。我使用的是离子的滚动事件上IonScroll:Ionic 2 - 当手指离开屏幕时不会触发滚动事件
import { Scroll } from 'ionic-angular';
@ViewChild(Scroll) scroll: Scroll;
...
ionViewDidLoad() {
this.scroll.addScrollEventListener((ev) => {
console.log('scroll');
});
}
在iOS上,当我把我的手指在屏幕上的滚动事件是完全解雇,但是当手指离开屏幕(但滚动延续,因为惯性),事件仅在滚动停止时被触发。
当手指离开屏幕时,是否有办法收听滚动事件(或任何其他类似事件)?
我发现这个问题,这似乎是相似的,但没有任何回答:iOS scroll event not firing as often when finger is off of the screen
你可以试试'touchmove'' touchstart'' touchend'事件 – Duannx
我想要的是当手指没有触摸屏幕时(即当内容由于iOS上的滚动动态而仍然滚动时)听滚动,我相信'touchstart '','touchend'和'touchmove'仅在手指在屏幕上时被触发... –