mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
Merge pull request #405 from NativeScript/fps-count-while-scrolling
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