Cantk中的窗口(UIWindow/UIScene)与Android的Activity等组件一样有完整的生命周期,假设我的Web应用有两个窗口:FirstWindow,SecondWindow,整个应用的生命应该如下图所示:
Created with Rapha?l 2.1.2FirstWindowFirstWindowSecondWindowSecondWindow1、FirstWindow‘s onSystemInit called2、SecondWindow‘s onSystemInit called3、FirstWindow‘s onLoad called4、SecondWindow‘s onLoad called5、FirstWindow‘s onBeforeOpen called6、FirstWindow‘s onOpen calledswitch to SecondWindow7、SecondWindow‘s onBeforeOpen called8、FirstWindow‘s onSwitchToBack called9、SecondWindow‘s onOpen calledswitch back to FirstWindow10、FirstWindow‘s onSwitchToFront called11、SecondWindow‘s onClose called12、FirstWindow‘s onClose called13、FirstWindow‘s onUnload called14、SecondWindow‘s onUnload called
流程相关事件的连接:
生命周期的在线demo:
时间: 2024-12-28 01:55:51