04
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
//创建承载视图,画纸
UIView *containerView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
containerView.backgroundColor = [UIColor whiteColor];
[self.window addSubview:containerView];
[containerView release];
CGFloat screenWidth = [[UIScreen mainScreen] bounds].size.width;
//创建一个自定义视图LTView
LTView *userNameLTV = [[LTView alloc] initWithFrame:CGRectMake(30, 80, screenWidth - 60, 40) text:@"用户名:" textColor:[UIColor blackColor] font:[UIFont boldSystemFontOfSize:18] borderStyle:UITextBorderStyleRoundedRect placeholder:@"请输入用户名" secureTextEntry:NO keyboardType:UIKeyboardTypeDefault];
userNameLTV.textField.delegate = self;
[containerView addSubview:userNameLTV];
[userNameLTV release];
LTView *passwordLTV = [[LTView alloc] initWithFrame:CGRectMake(30, 150, screenWidth - 60, 40) text:@"密 码:" textColor:[UIColor blackColor] font:[UIFont boldSystemFontOfSize:18] borderStyle:UITextBorderStyleRoundedRect placeholder:@"请输入密码" secureTextEntry:YES keyboardType:UIKeyboardTypeDefault];
passwordLTV.textField.delegate = self;
[containerView addSubview:passwordLTV];
[passwordLTV release];
//用户名 密码 确认密码 邮箱 电话号码
//创建一个视图控制器
RootViewController *rootVC = [[RootViewController alloc] init];
//将创建好的视图控制器指定为window的根视图控制器
self.window.rootViewController = rootVC;
//内存管理
[rootVC release];
[self.window makeKeyAndVisible];
return YES;
}

浙公网安备 33010602011771号