首页 > Windows开发 > 详细

UI基础 UIWindow

时间:2020-07-13 00:38:52      阅读:75      评论:0      收藏:0      [点我收藏+]

 

m

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
//    窗户在工程创建好就存在了 我需要创建程序的第一个页面并且添加到窗户上
    //创建第一个页面
    FirstViewController* first =[[FirstViewController alloc]init];
    
    //添加到窗户上(指定根视图)
    self.window.rootViewController=first;
    
    
    
    
    
    return YES;
}

 

FirstViewController m

@implementation FirstViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //更改背景颜色
    self.view.backgroundColor=[UIColor yellowColor];
    
    
 
}

 

UI基础 UIWindow

原文:https://www.cnblogs.com/zhangqing979797/p/13290884.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!