iOS:fix getLocationOnScreen

This commit is contained in:
pengfei.zhou 2020-04-15 16:37:37 +08:00 committed by osborn
parent 4c51a3c891
commit 380673ef03

View File

@ -393,7 +393,7 @@ - (NSNumber *)getY {
}
- (NSDictionary *)getLocationOnScreen {
CGPoint point = [self.view convertPoint:CGPointMake(0, 0) toView:[UIApplication sharedApplication].windows.lastObject];
CGPoint point = [self.view convertPoint:CGPointMake(0, 0) toView:[UIApplication sharedApplication].keyWindow];
return @{@"x": @(point.x), @"y": @(point.y)};
}