Program Entry and Appdelegate window display principle

Source: Internet
Author: User

Appdelegate.m

-(void) dealloc{[_window release]; [Super Dealloc];} -(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (nsdictionary *) launchOptions{self.    window = [[UIWindow alloc] Initwithframe:cgrectmake (0, 0, 320, 480)];        Self.window.backgroundColor = [Uicolor Redcolor];    /* Makekeyandvisible's role: 1. Let window display directly on the screen, this is the Window property, view does not have this property, if the room view, need to add to the other view on the display 2. Set the current window as the main window */        [_window makekeyandvisible];        _window.windowlevel = Uiwindowlevelstatusbar;    UIWindow *w2 = [[UIWindow alloc] Initwithframe:cgrectmake (0, 0, 90, 90)];   W2.backgroundcolor = [Uicolor greencolor];//[W2 makekeyandvisible];        I can't write this.//hidden: W2 is displayed on the main window, but W2 is not the main window W2.hidden = no;     /* Set window Priority: Uiwindowlevelnormal < Uiwindowlevelstatusbar < Uiwindowlevelalert;        The default is: Uiwindowlevelnormal */w2.windowlevel = Uiwindowlevelalert;    Get the main window of the current program UIWindow *W3 = Application.keywindow; NSLog (@ "Self.window:%@ ", Self.window);            NSLog (@ "w3:%@", W3); return YES;}


Program Entry and Appdelegate window display principle

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.