我是Xamarin IOS的新手。我无法找到登录后如何转到其他页面的解决方案。就像Android一样。有什么建议吗?
答案 0 :(得分:0)
无论您的loginPage是否包含在情节提要内,最好的方法是在登录后更改Window.RootViewController
中的AppDelegate
。
if (login)
{
AppDelegate app = UIApplication.SharedApplication.Delegate as AppDelegate;
app.changeOtherPage();
}
public void changeOtherPage ()
{
//if the page is contained in storyboard
UIStoryboard sb = UIStoryboard.FromName("SBName",null);
OtherPage callHistory = sb.InstantiateViewController("OtherPage") as OtherPage;
Window.RootViewController = callHistory;
//if the page is not contained in storyboard
Window.RootViewController = new OtherPage();
}