主要是mvc 模式
但此处没有涉及到数据, 只是铺键视图和vc 掌握即可
//
// RootViewController.m
// ui2 _设计模式
//
// Created by dllo on 15/11/9.
// Copyright (c) 2015年 dllo. All rights reserved.
//
#import "RootViewController.h"
#import "LTFView.h"
@interface RootViewController () <UIAlertViewDelegate>
@end
@implementation RootViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor blackColor];
LTFView *view = [[LTFView alloc]initWithFrame:CGRectMake(50, 100, [UIScreen mainScreen].bounds.size.width - 50 * 2, 30)];
view.label1.text = @"用户名";
view.field1.placeholder = @"请输入用户名";
LTFView *view1 = [[LTFView alloc]initWithFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y + view.frame.size.height + 30, view.frame.size.width, view.frame.size.height)];
view1.label1.text = @"密码";
view1.field1.placeholder = @"请输入密码";
UIAlertView *q = [[[UIAlertView alloc]initWithTitle:@"提示" message:@"尊敬的用户" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:@"取消", nil] autorelease];
[q show];
q.delegate = self;
[self.view addSubview:view];
[self.view addSubview:view1];
[view release];
[view1 release];
}
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
{
NSLog(@"ni hao");
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
//
// RootViewController.m
// ui2 _设计模式
//
// Created by dllo on 15/11/9.
// Copyright (c) 2015年 dllo. All rights reserved.
//
#import "RootViewController.h"
#import "LTFView.h"
@interface RootViewController () <UIAlertViewDelegate>
@end
@implementation RootViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor blackColor];
LTFView *view = [[LTFView alloc]initWithFrame:CGRectMake(50, 100, [UIScreen mainScreen].bounds.size.width - 50 * 2, 30)];
view.label1.text = @"用户名";
view.field1.placeholder = @"请输入用户名";
LTFView *view1 = [[LTFView alloc]initWithFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y + view.frame.size.height + 30, view.frame.size.width, view.frame.size.height)];
view1.label1.text = @"密码";
view1.field1.placeholder = @"请输入密码";
UIAlertView *q = [[[UIAlertView alloc]initWithTitle:@"提示" message:@"尊敬的用户" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:@"取消", nil] autorelease];
[q show];
q.delegate = self;
[self.view addSubview:view];
[self.view addSubview:view1];
[view release];
[view1 release];
}
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
{
NSLog(@"ni hao");
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end