سؤال

How can I force a TabBar button to load always the first view of a NavigationController?

I don't want to load the last in time loaded view but always come back to the first view of that NavigationController scheme.

Thank You very much!

هل كانت مفيدة؟

المحلول

Select the top view when you tap a TabBarItem like so:

 [someNaviagtionController popViewControllerAnimated:YES];

Depending on how you set your UITabBar up, call it either from tabBarController:shouldSelectViewController: or from tabBar:didSelectItem.

نصائح أخرى

You can call popToRootViewControllerAnimated:. Take a look here for more info.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top