feat:add getLocationOnScreen

This commit is contained in:
pengfei.zhou 2019-12-12 17:33:02 +08:00
parent df3be37bc4
commit 226ff3089a

View File

@ -317,6 +317,11 @@ - (NSNumber *)getHeight {
return @(self.view.height); return @(self.view.height);
} }
- (NSDictionary *)getLocationOnScreen {
CGPoint point = [self.view convertPoint:CGPointMake(0, 0) toView:[UIApplication sharedApplication].windows.lastObject];
return @{@"x": @(point.x), @"y": @(point.y)};
}
- (void)blendLayoutConfig:(NSDictionary *)params { - (void)blendLayoutConfig:(NSDictionary *)params {
[params[@"widthSpec"] also:^(NSNumber *it) { [params[@"widthSpec"] also:^(NSNumber *it) {
if (it) { if (it) {