iOS Dev (10) 创建一个简单的 UIView

iOS Dev (10) 创建一个简单的 UIView

  • 作者:CSDN 大锐哥
  • 地址:http://blog.csdn.net/prevention

创建一个 Empty App

创建一个 UIView

- (BOOL) application: (UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *) launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    UIView *myView = [[UIView alloc] initWithFrame:CGRectMake(10, 30, 200, 200)];
    myView.backgroundColor = [UIColor redColor];
    [self.window addSubView:myView];

    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];

    return YES;
}

你可能感兴趣的:(iOS Dev (10) 创建一个简单的 UIView)