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的作用:
1.让window在屏幕上直接显示,这是window的属性。view没有这个属性,假设室view,须要加入到其它的视图上显示
2.将当前窗体设置为主窗体
*/
[_window makeKeyAndVisible]; _window.windowLevel = UIWindowLevelStatusBar; UIWindow *w2 = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 90, 90)];
w2.backgroundColor = [UIColor greenColor];
// [w2 makeKeyAndVisible]; 不能这么写 //hidden的作用:在主窗体上显示w2,可是w2不是主窗体
w2.hidden = NO; /*
设置window的优先级:UIWindowLevelNormal < UIWindowLevelStatusBar < UIWindowLevelAlert;
默认是:UIWindowLevelNormal
*/
w2.windowLevel = UIWindowLevelAlert; //拿到当前程序的主window
UIWindow *w3 = application.keyWindow;
NSLog(@"self.window:%@",self.window);
NSLog(@"w3:%@",w3); return YES;
}

程序的入口及AppDelegate窗体显示原理的更多相关文章

  1. 从零开始学android开发- 应用程序窗体显示状态操作requestWindowFeature

    我们在开发程序是经常会需要软件全屏显示.自定义标题(使用按钮等控件)和其他的需求,今天这一讲就是如何控制Android应用程序的窗体显示. 首先介绍一个重要方法那就是requestWindowFeat ...

  2. Android开发之应用程序窗体显示状态操作(requestWindowFeature()的应用)

    转自:http://www.cnblogs.com/salam/archive/2010/11/30/1892143.html 我们在开发程序是经常会需要软件全屏显示.自定义标题(使用按钮等控件)和其 ...

  3. Android 应用程序窗体显示状态操作(requestWindowFeature()的应用)

     我们在开发程序是经常会需要软件全屏显示.自定义标题(使用按钮等控件)和其他的需求,今天这一讲就是如何控制Android应用程序的窗体显示. 首先介绍一个重要方法那就是requestWindowF ...

  4. Android 应用程序窗体显示状态操作(requestWindowFeature()的应用)(转载)

    转自:http://www.cnblogs.com/salam/archive/2010/11/30/1892143.html 我们在开发程序是经常会需要软件全屏显示.自定义标题(使用按钮等控件)和其 ...

  5. IOS应用程序生命周期的AppDelegate详解

    IOS 中的 AppDelegate.m/h 文件是很重要的呢,因为它是对 Application 的整个生命周期进行管理的. 先明白,每个iPhone应用程序都有一个UIApplication,UI ...

  6. Creating Dialogbased Windows Application (1) / 创建基于对话框的Windows应用程序(一)新建窗体 / VC++, Windows

    创建基于对话框的Windows应用程序(一) —— 新建窗体 1.新建一个Visual C++的Empty Project.  2.在Solution Explorer中右键Add New Item, ...

  7. 一张图搞定OAuth2.0 在Office应用中打开WPF窗体并且让子窗体显示在Office应用上 彻底关闭Excle进程的几个方法 (七)Net Core项目使用Controller之二

    一张图搞定OAuth2.0   目录 1.引言 2.OAuth2.0是什么 3.OAuth2.0怎么写 回到顶部 1.引言 本篇文章是介绍OAuth2.0中最经典最常用的一种授权模式:授权码模式 非常 ...

  8. cocos2dx[3.2](4) 入口类AppDelegate

    这是游戏程序的入口,主要用于游戏程序的逻辑初始化,并创建运行程序的入口界面(即第一个游戏界面场景). 里面有三个方法: // applicationDidFinishLaunching(); //逻辑 ...

  9. Main 程序的入口要做哪些事情

    Main 程序的入口要做哪些事: 1.从主类中实例化程序(UIApplication)对象 2.如果有委托的话,从给定的类实例化委托和设置程序(UIApplication) 的代理. 3.开启主事件的 ...

随机推荐

  1. shopnc 店铺二级分类添加商品

    $class_2 = $goods_class[$gc_id]['gc_parent_id']; $class_1 = $goods_class[$class_2]['gc_parent_id']; ...

  2. 剑指offer-二叉查找树的第 K 个结点

    /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * Tre ...

  3. vue组件scoped CSS及/deep/深度选择器

    参考链接:https://vue-loader.vuejs.org/zh/guide/scoped-css.html#%E5%AD%90%E7%BB%84%E4%BB%B6%E7%9A%84%E6%A ...

  4. [BZOJ1913][APIO2010]信号覆盖(计算几何+计数)

    1913: [Apio2010]signaling 信号覆盖 Time Limit: 20 Sec  Memory Limit: 64 MBSubmit: 1658  Solved: 672[Subm ...

  5. [BZOJ4861][BJOI2017]魔法咒语(AC自动机+矩阵优化DP)

    4861: [Beijing2017]魔法咒语 Time Limit: 20 Sec  Memory Limit: 256 MBSubmit: 217  Solved: 105[Submit][Sta ...

  6. poj 1127(直线相交+并查集)

    Jack Straws Description In the game of Jack Straws, a number of plastic or wooden "straws" ...

  7. 【推导】【找规律】【二分】hdu6154 CaoHaha's staff

    题意:网格图.给你一个格点多边形的面积,问你最少用多少条边(可以是单位线段或单位对角线),围出这么大的图形. 如果我们得到了用n条边围出的图形的最大面积f(n),那么二分一下就是答案. n为偶数时,显 ...

  8. rmq问题:ST表

    存板子.O(nlogn)预处理,O(1)查询.空间O(nlogn). int d[1000006][25]; int mn[1000006]; void rmq_init() { for(int i= ...

  9. 20162312 实验一 Linux基础与Java开发环境

    实 验 报 告 课程:程序设计与数据结构 姓名:张家铖 班级:1623 学号:20162312 实验名称: Linux基础与Java开发环境 实验器材:msi GL62M 7RD 实验目的与要求:1. ...

  10. python3-开发进阶Django中序列化以及rest_framework的序列化

    一.django框架的序列化 直接上代码 1.这是app下的models.py from django.db import models # Create your models here. clas ...