Xamarin 删除故事板
Xamarin remove storyboard
我按照教程创建了 mvvmcross 解决方案。一切正常,但我注意到有 FirstView(带有 xib/cs/designer.cs)和故事板。如何删除故事板并在此项目上使用纯 xibs?
我尝试删除 Main.storyboard 和 ViewController.cs/designer.cs,但这只会使应用程序崩溃,根本不会加载 FirstView。求助!
如果删除 Storyboard,还需要更新 info.Plist
文件。
从主界面
中删除文本Main
现在您需要更新您应用的 AppDelegate 以将您的 ViewController 设置为 RootViewController(ViewController 应用将在完成加载时调用)。
要使用如下代码更新您的 FinishedLaunching
方法:
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
Window = new UIWindow (UIScreen.MainScreen.Bounds);
Window.RootViewController = new YourViewController ();
Window.MakeKeyAndVisible ();
return true;
}
这应该有效。
我按照教程创建了 mvvmcross 解决方案。一切正常,但我注意到有 FirstView(带有 xib/cs/designer.cs)和故事板。如何删除故事板并在此项目上使用纯 xibs?
我尝试删除 Main.storyboard 和 ViewController.cs/designer.cs,但这只会使应用程序崩溃,根本不会加载 FirstView。求助!
如果删除 Storyboard,还需要更新 info.Plist
文件。
从主界面
中删除文本Main
现在您需要更新您应用的 AppDelegate 以将您的 ViewController 设置为 RootViewController(ViewController 应用将在完成加载时调用)。
要使用如下代码更新您的 FinishedLaunching
方法:
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
Window = new UIWindow (UIScreen.MainScreen.Bounds);
Window.RootViewController = new YourViewController ();
Window.MakeKeyAndVisible ();
return true;
}
这应该有效。