I have an application (Xamarin.IOS) which start with a UIViewController (Connection view) with no TabBar. But when user Logged, I\'d like to add the tabbar that I\'ve create
Tab -> No Tab
When Push
ViewController2 vc2 = new ViewController2();
vc2.HidesBottomBarWhenPushed = true; //add this line
this.NavigationController.PushViewController(vc2, true);
When Present
this.PresentViewController(new ViewController2(), true, null);
No Tab -> Tab
Set Connection Page as RootViewController at first, and then change it when you want to.
Code:
public partial class AppDelegate : UIApplicationDelegate
{
UIWindow window;
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
window.RootViewController = new UINavigationController(new ViewController1());
window.MakeKeyAndVisible();
return true;
}
public void changeRootVC()
{
window.RootViewController = new TabController();
}
}
And change it in Connection Page
if(connected){
AppDelegate app = UIApplication.SharedApplication.Delegate as AppDelegate;
app.changeRootVC();
}