feat:Popover area do not over the root view's area

This commit is contained in:
pengfei.zhou
2020-09-04 15:04:55 +08:00
committed by osborn
parent a8cbdc0c1d
commit cf2b5b3fac
3 changed files with 127 additions and 43 deletions

View File

@@ -15,7 +15,7 @@ @implementation DoricPopoverPlugin
- (void)show:(NSDictionary *)params withPromise:(DoricPromise *)promise {
dispatch_async(dispatch_get_main_queue(), ^{
UIView *superView = [UIApplication sharedApplication].windows.lastObject;
UIView *superView = self.doricContext.vc.view;
if (!self.fullScreenView) {
self.fullScreenView = [[UIView new] also:^(UIView *it) {
it.width = superView.width;
@@ -24,6 +24,9 @@ - (void)show:(NSDictionary *)params withPromise:(DoricPromise *)promise {
it.doricLayout.layoutType = DoricStack;
[superView addSubview:it];
}];
} else {
self.fullScreenView.doricLayout.width = superView.width;
self.fullScreenView.doricLayout.height = superView.height;
}
[superView bringSubviewToFront:self.fullScreenView];
self.fullScreenView.hidden = NO;