feat:add getX and getY for view

This commit is contained in:
pengfei.zhou
2020-03-03 14:22:33 +08:00
committed by osborn
parent 0641f5e223
commit 35e9f05114
5 changed files with 38 additions and 10 deletions

View File

@@ -319,6 +319,14 @@ - (NSNumber *)getHeight {
return @(self.view.height);
}
- (NSNumber *)getX {
return @(self.view.x);
}
- (NSNumber *)getY {
return @(self.view.y);
}
- (NSDictionary *)getLocationOnScreen {
CGPoint point = [self.view convertPoint:CGPointMake(0, 0) toView:[UIApplication sharedApplication].windows.lastObject];
return @{@"x": @(point.x), @"y": @(point.y)};