Slack Shot is on the right track. The reason you are having issues is because you are structuring your application strangely. You should not have the window.MakeKeyAndVisible
or window.RootViewController
assignments in your SecondLoginView
class.
You can add your rootVC
as a subview like this:
View.Add(rootVC.View);
I am sure you can do it some way with the code you have, but the way I always use a DialogViewController
(if its the only view meant to be on the screen) I inherit directly from it. If you want to provide some common overlay code, make your BaseView a DialogViewController
and inherit that.
Something like:
public partial class BaseDialogController : DialogViewController
{
LoadingOverlay loadingOverlay;
public void ProgressDialogShow(string message, string title)
{
loadingOverlay = new LoadingOverlay(message, UIScreen.MainScreen.Bounds);
View.Add(loadingOverlay);
}
}
You should remove this code from the view controller:
nav = new UINavigationController(rootVC);
window.RootViewController = nav;
window.MakeKeyAndVisible();
If you want to make your controller in a nav
, do it wherever you create SecondViewController. In your case, it might be in the storyboard file.