iOS:fix popover view

This commit is contained in:
pengfei.zhou 2020-04-08 16:16:57 +08:00 committed by osborn
parent 7f26910f0c
commit 8b66c7d4be

View File

@ -18,10 +18,10 @@ - (void)show:(NSDictionary *)params withPromise:(DoricPromise *)promise {
UIView *superView = [UIApplication sharedApplication].windows.lastObject; UIView *superView = [UIApplication sharedApplication].windows.lastObject;
if (!self.fullScreenView) { if (!self.fullScreenView) {
self.fullScreenView = [[UIView new] also:^(UIView *it) { self.fullScreenView = [[UIView new] also:^(UIView *it) {
it.doricLayout.layoutType = DoricStack;
it.width = superView.width; it.width = superView.width;
it.height = superView.height; it.height = superView.height;
it.top = it.left = 0; it.top = it.left = 0;
it.doricLayout.layoutType = DoricStack;
[superView addSubview:it]; [superView addSubview:it];
}]; }];
} }
@ -34,12 +34,11 @@ - (void)show:(NSDictionary *)params withPromise:(DoricPromise *)promise {
viewNode = [[DoricViewNode create:self.doricContext withType:type] also:^(DoricViewNode *it) { viewNode = [[DoricViewNode create:self.doricContext withType:type] also:^(DoricViewNode *it) {
it.viewId = viewId; it.viewId = viewId;
[it initWithSuperNode:nil]; [it initWithSuperNode:nil];
it.view.doricLayout = [DoricLayout new];
[self.fullScreenView addSubview:it.view]; [self.fullScreenView addSubview:it.view];
NSMutableDictionary <NSString *, DoricViewNode *> *map = self.doricContext.headNodes[TYPE]; NSMutableDictionary <NSString *, DoricViewNode *> *map = self.doricContext.headNodes[TYPE];
if (map != nil) { if (map != nil) {
self.doricContext.headNodes[TYPE][viewId] = it; self.doricContext.headNodes[TYPE][viewId] = it;
} else { } else {
map = [[NSMutableDictionary alloc] init]; map = [[NSMutableDictionary alloc] init];
map[viewId] = it; map[viewId] = it;
@ -48,6 +47,7 @@ - (void)show:(NSDictionary *)params withPromise:(DoricPromise *)promise {
}]; }];
} }
[viewNode blend:params[@"props"]]; [viewNode blend:params[@"props"]];
[self.fullScreenView.doricLayout apply];
[promise resolve:nil]; [promise resolve:nil];
}); });
} }