Aller à racineview à partir d'une autre vue quand un bouton tapa
-
02-01-2020 - |
Question
J'utilise pour modifier les onglets (ROOTVIEW) à l'aide de ce code:
NSInteger tabitem = tabBarController.selectedIndex;
[[tabBarController.viewControllers objectAtIndex:tabitem] popToRootViewControllerAnimated:YES];
Mais lorsque je veux utiliser un bouton pour modifier l'onglet d'une vue, je ne peux pas afficher la review.J'utilise ce code mais il ne montre pas la racine:
self.tabBarController.selectedIndex = 3;
La solution
C'est la solution:
https://stackoverflow.com/a/12681125/3507283
int index = 3;
self.tabBarController.selectedIndex = index;
[self.tabBarController.viewControllers[index] popToRootViewControllerAnimated:NO];
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow