mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
FPS module will now correctly count frames while scrolling in iOS
This commit is contained in:
@ -35,6 +35,9 @@ export class FPSCallback implements definition.FPSCallback {
|
|||||||
this.displayLink = CADisplayLink.displayLinkWithTargetSelector(this.impl, "handleFrame");
|
this.displayLink = CADisplayLink.displayLinkWithTargetSelector(this.impl, "handleFrame");
|
||||||
this.displayLink.paused = true;
|
this.displayLink.paused = true;
|
||||||
this.displayLink.addToRunLoopForMode(NSRunLoop.currentRunLoop(), NSDefaultRunLoopMode);
|
this.displayLink.addToRunLoopForMode(NSRunLoop.currentRunLoop(), NSDefaultRunLoopMode);
|
||||||
|
// UIScrollView (including in UIITableView) will run a loop in UITrackingRunLoopMode during scrolling.
|
||||||
|
// If we do not add the CADisplayLink in this mode, it would appear paused during scrolling.
|
||||||
|
this.displayLink.addToRunLoopForMode(NSRunLoop.currentRunLoop(), UITrackingRunLoopMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
public start() {
|
public start() {
|
||||||
|
Reference in New Issue
Block a user