zoukankan      html  css  js  c++  java
  • iOS UIViewController use

    UIViewController use

    1 appdelegate.m  

      - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

    {

        self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];

        // Override point for customization after application launch.

        self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];

        self.window.rootViewController = self.viewController;

        [self.window makeKeyAndVisible];

        return YES;

    }

    ViewController.h

      @interface ViewController : UIViewController 

    3 viewcontroller.m

    - (void)viewWillAppear:(BOOL)animated

    {

        [super viewWillAppear:animated];

        self.view.backgroundColor=[UIColor brownColor];

        //UIImage *img = [UIImage imageNamed:@"app_bg.png"];

        //self.view.backgroundColor=[UIColor colorWithPatternImage:img];

        if(!self.array)

        {

            self.array=[NSArray arrayWithObjects:@"aa",@"bb",@"cc", nil];

        }

        self.title=@"test";

        UILabel* label1=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];

        label1.backgroundColor=[UIColor blackColor];

        label1.text=[self.array objectAtIndex:0];

        [self.view addSubview:label1];

    } 

  • 相关阅读:
    easyUI之tree
    MSSQL索引优化
    MongoDB学习笔记(一) MongoDB介绍及安装
    项目经理必备的11种人际关系技能
    http协议详细介绍
    ERP存储过程
    UVA1339 UVALive3213 POJ2159 ZOJ2658 Ancient Cipher【密码】
    UVA1588 UVALive3712 POJ3158 Kickdown
    UVA1588 UVALive3712 POJ3158 Kickdown
    UVA10340 POJ1936 ZOJ1970 All in All【字符串匹配】
  • 原文地址:https://www.cnblogs.com/csj007523/p/2642671.html
Copyright © 2011-2022 走看看