-
Notifications
You must be signed in to change notification settings - Fork 50
Toast displayed behind a modal #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Just created : - (UIViewController *)visibleViewController:(UIViewController *)rootViewController
{
if (rootViewController.presentedViewController == nil)
{
return rootViewController;
}
if ([rootViewController.presentedViewController isKindOfClass:[UINavigationController class]])
{
UINavigationController *navigationController = (UINavigationController *)rootViewController.presentedViewController;
UIViewController *lastViewController = [[navigationController viewControllers] lastObject];
return [self visibleViewController:lastViewController];
}
if ([rootViewController.presentedViewController isKindOfClass:[UITabBarController class]])
{
UITabBarController *tabBarController = (UITabBarController *)rootViewController.presentedViewController;
UIViewController *selectedViewController = tabBarController.selectedViewController;
return [self visibleViewController:selectedViewController];
}
UIViewController *presentedViewController = (UIViewController *)rootViewController.presentedViewController;
return [self visibleViewController:presentedViewController];
} and edited dispatch_async(dispatch_get_main_queue(), ^{
//UIView *root = [[[[[UIApplication sharedApplication] delegate] window] rootViewController] view];
UIViewController *ctrl = [self visibleViewController:[UIApplication sharedApplication].keyWindow.rootViewController];
UIView *root = [ctrl view]; And I got it working. Do you want a PR for that? |
Well I created a patch of your changes on my project and included that on installation step. So even without merged pull and new version - your changes worked. Thanks a lot. |
Same issue. |
Any update on this? Would love to see this fixed. |
@luoruidong , Thanks. |
@Crash-- thank you so much but could you please make a PR for this fix? i couldn't get it work in my project |
This module works great with "simple" view on iOS. But as soon as I open a modal (I use this module for my navigation stack https://github.com/wix/react-native-navigation), the toast is displayed behind and I can't see it.
Is it something we can manage inside react-native-simple-toast ?
The text was updated successfully, but these errors were encountered: