zoukankan      html  css  js  c++  java
  • UIWindow

    window相当于个画板,想要展现的图像或则图形,需要把画的东西画在window画板上;
    UIWindow继承于UIView,在UI中所有能看的到的东西,都继承于UIView。在iOS中,通常UIWindow来表示,每个APP都要把展现的东西写在UIWindow上。通常一个APP创建一个UIWindow对象。
    //
    //  AppDelegate.m
    //  UIWindow
    //  Created by cqy on 16/2/12.
    //  Copyright © 2016年 程清杨. All rights reserved.
    #import "AppDelegate.h"
    @interface AppDelegate ()
    @end
    @implementation AppDelegate
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        //创建UIWindow对象,初始化时设置UIWindow的位置与屏幕相同。
        self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
        //设置UIWindow的背景颜色
        self.window.backgroundColor = [UIColor whiteColor];
        //设置显示UIWindow
        [self.window makeKeyAndVisible];
       
        // Override point for customization after application launch.
        return YES;
    }

    - (void)applicationWillResignActive:(UIApplication *)application {
        // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
        // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
    }

    - (void)applicationDidEnterBackground:(UIApplication *)application {
        // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
        // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
    }

    - (void)applicationWillEnterForeground:(UIApplication *)application {
        // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
    }

    - (void)applicationDidBecomeActive:(UIApplication *)application {
        // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    }

    - (void)applicationWillTerminate:(UIApplication *)application {
        // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
    }
    @end
    注释:1、initWithFrame:[[UIScreen mainScreen] bounds],初始化window,使这个window跟屏幕⼀样⼤⼩。
    2、backgroundColor,设置背景⾊
    3、makeKeyAndVisible,把window设置成可显⽰的
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
  • 相关阅读:
    常用JQuery插件整理
    SSL为Windows server 2008 IIS7进行加密连接
    使用SVN+CruiseControl+ANT实现持续集成之一
    持续化集成工具CruiseControl.NET
    用Asp.net写自己的服务框架
    使用CruiseControl+SVN+ANT实现持续集成之三
    CSLA学习之控制菜单可见性
    Oracle 动态SQL语句(3)之保存存储过程
    Oracle数据库编程之Float与Double
    当函数需要传入较多的参数,可分装成结构体
  • 原文地址:https://www.cnblogs.com/iQingYang/p/5193152.html
Copyright © 2011-2022 走看看