您的位置:首页 > 产品设计 > UI/UE

UI_最基础的登陆界面

2015-07-30 08:36 302 查看
#import "AppDelegate.h"

@interface AppDelegate ()

@end

@implementation AppDelegate
- (void)dealloc
{
[_window release];
[super dealloc];
}

- (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];
[self.window makeKeyAndVisible];
[_window release];

UILabel *labelUser = [[UILabel alloc] initWithFrame:CGRectMake(80,
80, 80,
40)];
labelUser.backgroundColor = [UIColor whiteColor];
[self.window addSubview:labelUser];
[labelUser release];

labelUser.text =
@"用户名";
labelUser.numberOfLines =
0;

UITextView *textUser = [[UITextView alloc] initWithFrame:CGRectMake(160,
80, 180,
40)];
textUser.backgroundColor = [UIColor whiteColor];
[self.window addSubview:textUser];
[textUser release];

textUser.text =
@"请输入用户名";
textUser.font = [UIFont systemFontOfSize:20];
textUser.layer.borderWidth =
1;
textUser.layer.cornerRadius =
5;
textUser.alpha =
0.3;

UILabel *labelPassWd = [[UILabel alloc] initWithFrame:CGRectMake(80,
140, 80,
40)];
labelPassWd.backgroundColor = [UIColor whiteColor];
[self.window addSubview:labelPassWd];
[labelPassWd release];

labelPassWd.text =
@"密码";
labelPassWd.numberOfLines =
0;

UITextView *textPassWd = [[UITextView alloc] initWithFrame:CGRectMake(160,
140, 180,
40)];
textPassWd.backgroundColor = [UIColor whiteColor];
[self.window addSubview:textPassWd];
[textPassWd release];

textPassWd.text =
@"请输入密码";
textPassWd.font = [UIFont systemFontOfSize:20];
textPassWd.layer.borderWidth =
1;
textPassWd.layer.cornerRadius =
5;
textPassWd.alpha =
0.3;

UILabel *labelConPassWd = [[UILabel alloc] initWithFrame:CGRectMake(80,
200, 80,
40)];
labelConPassWd.backgroundColor = [UIColor whiteColor];
[self.window addSubview:labelConPassWd];
[labelConPassWd release];

labelConPassWd.text =
@"确认密码";
labelConPassWd.numberOfLines =
0;

UITextView *textConPassWd = [[UITextView alloc] initWithFrame:CGRectMake(160,
200, 180,
40)];
textConPassWd.backgroundColor = [UIColor whiteColor];
[self.window addSubview:textConPassWd];
[textConPassWd release];

textConPassWd.text =
@"再次输入密码";
textConPassWd.font = [UIFont systemFontOfSize:20];
textConPassWd.layer.borderWidth =
1;
textConPassWd.layer.cornerRadius =
5;
textConPassWd.alpha =
0.3;

UILabel *labelPhoneNum = [[UILabel alloc] initWithFrame:CGRectMake(80,
260, 80,
40)];
labelPhoneNum.backgroundColor = [UIColor whiteColor];
[self.window addSubview:labelPhoneNum];
[labelPhoneNum release];

labelPhoneNum.text =
@"手机号";
labelPhoneNum.numberOfLines =
0;

UITextView *textPhoneNum = [[UITextView alloc] initWithFrame:CGRectMake(160,
260, 180,
40)];
textPhoneNum.backgroundColor = [UIColor whiteColor];
[self.window addSubview:textPhoneNum];
[textPhoneNum release];

textPhoneNum.text =
@"请输入联系人方式";
textPhoneNum.font = [UIFont systemFontOfSize:20];
textPhoneNum.layer.borderWidth =
1;
textPhoneNum.layer.cornerRadius =
5;
textPhoneNum.alpha =
0.3;

UILabel *labelEamil = [[UILabel alloc] initWithFrame:CGRectMake(80,
320, 80,
40)];
labelEamil.backgroundColor = [UIColor whiteColor];
[self.window addSubview:labelEamil];
[labelEamil release];

labelEamil.text =
@"邮箱";
labelEamil.numberOfLines =
0;

UITextView *textEamil = [[UITextView alloc] initWithFrame:CGRectMake(160,
320, 180,
40)];
textEamil.backgroundColor = [UIColor whiteColor];
[self.window addSubview:textEamil];
[textEamil release];

textEamil.text =
@"请输入邮箱";
textEamil.font = [UIFont systemFontOfSize:20];
textEamil.layer.borderWidth =
1;
textEamil.layer.cornerRadius =
5;
textEamil.alpha =
0.3;

UIButton *buttonReg = [UIButton buttonWithType:UIButtonTypeSystem];
buttonReg.frame = CGRectMake(100,
400, 60,
40);
[self.window addSubview:buttonReg];

[buttonReg setTitle:@"注册" forState:UIControlStateNormal];
buttonReg.titleLabel.font = [UIFont systemFontOfSize:20];

[buttonReg addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];

UIButton *buttonCancel = [UIButton buttonWithType:UIButtonTypeSystem];
buttonCancel.frame = CGRectMake(200,
400, 60,
40);
[self.window addSubview:buttonCancel];

[buttonCancel setTitle:@"取消" forState:UIControlStateNormal];
buttonCancel.titleLabel.font = [UIFont systemFontOfSize:20];

[buttonCancel addTarget:self action:@selector(clickCancel:) forControlEvents:UIControlEventTouchUpInside];

return
YES;
}

- (void)click:(UIButton *)buttonReg{
NSLog(@"注册界面");
}

- (void)clickCancel:(UIButton *)buttonCancel{
NSLog(@"取消");
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: