我有一个被涂成红色的UIViewController,这个viewController是我想要看到的第一个屏幕,但从来没有从ViewController开始,我做错了什么?
UIWindow window;
[Export("window")]
public UIWindow Window { get; set; }
[Export("application:didFinishLaunchingWithOptions:")]
public bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
window = new UIWindow(UIScreen.MainScreen.Bounds);
View view = new View();
UINavigationController navigationMain = new UINavigationController(view);
window.MakeKeyAndVisible();
window.RootViewController = navigationMain;
return true;
}
我知道这个错误:
Proyect[4195:115403] SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=4195
Proyect[4195:115403] SecTaskCopyDebugDescription: Proyect[4195]/0#-1 LF=0
Proyect[4195:115403] SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=4195
Proyect[4195:115403] SecTaskCopyDebugDescription: Proyect[4195]/0#-1 LF=0
发布于 2019-11-05 18:54:45
在iOS 13 (及以上)上,场景委托接管了应用程序委托的一些角色。最重要的是,窗口的概念被场景的概念所取代。一个应用程序可以有多个场景,一个场景现在可以作为应用程序的用户界面和内容的背景。
从iOS 13开始,SceneDelegate负责设置应用程序的场景,以及设置它们的初始视图。
[Export ("scene:willConnectToSession:options:")]
public void WillConnect (UIScene scene, UISceneSession session, UISceneConnectionOptions connectionOptions)
{
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see UIApplicationDelegate `GetConfiguration` instead).
UIWindowScene myScene = scene as UIWindowScene;
Window = new UIWindow(myScene);
UIViewController viewController = new UIViewController();
UINavigationController navigationMain = new UINavigationController(viewController );
Window.RootViewController = navigationMain;
Window.MakeKeyAndVisible();
}
有关更多信息,请阅读这篇文章和在iOS13中观看优化应用程序发布的官方视频。
https://stackoverflow.com/questions/58717629
复制相似问题