IOS Study Notes (6) -- ViewController

Source: Internet
Author: User


 

 
 

 

 

 

 

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];    // Override point for customization after application launch.    self.window.backgroundColor = [UIColor whiteColor];        MainUIViewController *vc=[[MainUIViewController alloc]initWithNibName:@"MainUIViewController" bundle:nil];    self.window.rootViewController=vc;        [self.window makeKeyAndVisible];    return YES;


 

 

Code to create a view.

- (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];    //    MainUIViewController *vc=[[MainUIViewController alloc]initWithNibName:@"MainUIViewController" bundle:nil];//    self.window.rootViewController=vc;        RootViewController *rc=[[RootViewController alloc] init];    self.window.rootViewController=rc;        [self.window makeKeyAndVisible];    return YES;}

 

 

- (void)loadView{    [super loadView];        UIView *view=[[UIView alloc]initWithFrame:[UIScreen mainScreen].applicationFrame];    view.alpha=0.5;    view.backgroundColor=[UIColor cyanColor];    self.view=view;}

 

 

 

 

* @ Author Zhang xingye * http://blog.csdn.net/xyz_lmn* iOS entry group: * android development advanced group: * my Sina Weibo: @ Zhang xingye TBOW*/

 

 

 

Refer:

Https://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007457-CH1-SW1

Http://xcodev.com/341.html

Http://iostrack.com/post/2012-07-20/40029700941

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.