IOS初级:UIwindow
来源:互联网 发布:北上广深经济数据对比 编辑:程序博客网 时间:2024/05/22 04:42
AppDelegate.h
@property (strong, nonatomic) UIWindow *window;
AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.window.backgroundColor = [UIColor yellowColor]; [self.window makeKeyAndVisible]; // Override point for customization after application launch. return YES;}
UIWindow的父类UIView,代码中的initWithFrame方法、backgroundColor成员均来自UIView。
其中initWithFrame方法的参数是CGRect类型的,返回的是一个UIWindow的指针。
UIScreen的类方法mainScreen的返回是设备内部屏幕信息的一个UIScreen的指针。
UIScreen的成员bounds是一个CGRect类型的值,表示全尺寸屏幕的坐标。
UIColor是生成颜色值的类,这里不多说。
UIWindows的方法makeKeyAndVisible是让当前的这个UIWindow类型的对象成为应用程序的主窗口,并使他可见。
CGRect坐标表示方法:相对与父窗口的偏移x,y和本身的长和宽。
0 0
- IOS初级:UIwindow
- iOS UI初级-UIVew与UIWindow
- iOS之UI初级---UIWindow的基本内容
- iOS学习之UI初级————UIWindow
- iOS UIWindow
- ios UIwindow
- iOS UIWindow
- iOS: UIWindow in iOS
- iOS: UIWindow in iOS
- IOS 应用UIWindow分析
- ios UIWindow & UIWindowLevel
- 【iOS学习】----UIWindow
- iOS UIKit :UIWindow
- iOS UIKit :UIWindow
- IOS获取 UIWindow
- UIWindow in iOS
- IOS学习之UIWindow
- ios UIWindow & UIWindowLevel
- JavaScript语法高亮库highlight.js使用
- IOS调试错误:Unable to run app in Simulator
- Java程序数据库连接,数据源配置,数据库连接池
- 怎么使用focus插件制作动态图册
- HTML5视频及其兼容实践
- IOS初级:UIwindow
- poj3660 Cow Contest(Floyd-Warshall方法求有向图的传递闭包)
- 华为OJ之初级篇Ⅱ
- mark-fragment中获取控件的时机
- 第五章t9
- 设计模式
- Hadoop学习笔记(八)---内置数据类型与自定义数据类型
- 秦淮八艳
- 第五章t10