//
// AppDelegate.m
// lagou
//
// Created by lanou3g on 17/8/4.
// Copyright © 2017年 lanou3g. All rights reserved.
//
#import "AppDelegate.h"
#import "RootViewController.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
RootViewController *rootViewController = [[RootViewController alloc] init];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController];
self.window.rootViewController = navigationController;
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end
//
// RootViewController.m
// lagou
//
// Created by lanou3g on 17/8/4.
// Copyright © 2017年 lanou3g. All rights reserved.
//
#import "RootViewController.h"
#import "UIImage+FEBoxBlur.h"
#import "MyInputView.h"
#import "SetupViewController.h"
#import "RemberViewController.h"
@interface RootViewController ()
@property (nonatomic,retain) UIImage *image;
@property (nonatomic,retain) UIImageView *imageView;
@property (nonatomic,retain) MyInputView *myinputView;
@end
@implementation RootViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.navigationController.navigationBar.translucent = YES;
self.navigationController.navigationBarHidden = YES;
self.view.backgroundColor = [UIColor whiteColor];
[self configImageTwo];
UIImageView *topImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo_lagou.png"]];
CGFloat width = 110;
CGFloat height = 180;
topImageView.frame = CGRectMake((self.view.frame.size.width - width) / 2, 120, width, height);
[self.view addSubview:topImageView];
self.myinputView = [[MyInputView alloc] initWithFrame:CGRectMake(((self.view.frame.size.width)-(self.view.frame.size.width-20))/2, 320, self.view.frame.size.width-20, 82)];
self.myinputView.layer.cornerRadius = 8.f;
self.myinputView.layer.masksToBounds = YES;
[self.view addSubview:self.myinputView];
UIBarButtonItem *backIetm = [[UIBarButtonItem alloc] init];
backIetm.title = @"返回";
self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:0 green:172.0f/255.0f blue:135.0f/255.0f alpha:1];
self.navigationItem.backBarButtonItem = backIetm;
// UITextField *textFieldName = [[UITextField alloc] initWithFrame:CGRectMake(((self.view.frame.size.width)-(self.view.frame.size.width-20))/2, 320, self.view.frame.size.width-20, 41)];
// textFieldName.borderStyle = UITextBorderStyleRoundedRect;
// [textFieldName setBackgroundColor:[UIColor colorWithRed:51/255 green:51/255 blue:51/255 alpha:0.25]];
// textFieldName.tag = 1005;
// [textFieldName addTarget:self action:@selector(textFieldAction:) forControlEvents: UIControlEventTouchDown];
// [textFieldName addTarget:self action:@selector(textFieldAction1:) forControlEvents: UIControlEventEditingDidEnd];
// [self.view addSubview:textFieldName];
//
// UIImageView *leftView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 41, 41)];
// leftView.backgroundColor = [UIColor colorWithRed:51/255 green:51/255 blue:51/255 alpha:0.5];
// leftView.image = [UIImage imageNamed:@"icon_username.png"];
// textFieldName.leftView = leftView;
// textFieldName.leftViewMode = UITextFieldViewModeAlways;
// leftView.layer.cornerRadius = 5;
// [textFieldName addTarget:self action:@selector(textFieldAction:) forControlEvents:UIControlEventTouchUpInside];
//
// UITextField *textFieldPassWord = [[UITextField alloc] initWithFrame:CGRectMake(((self.view.frame.size.width)-(self.view.frame.size.width-20))/2, 362.5, self.view.frame.size.width-20, 41)];
// textFieldPassWord.borderStyle = UITextBorderStyleRoundedRect;
// [textFieldPassWord setBackgroundColor:[UIColor colorWithRed:51/255 green:51/255 blue:51/255 alpha:0.25]];
// [textFieldPassWord addTarget:self action:@selector(textFieldActionp:) forControlEvents: UIControlEventTouchDown];
// [textFieldPassWord addTarget:self action:@selector(textFieldActionp1:) forControlEvents: UIControlEventEditingDidEnd];
// [self.view addSubview:textFieldPassWord];
//
// UIImageView *leftView1 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 41, 41)];
// leftView1.backgroundColor = [UIColor colorWithRed:51/255 green:51/255 blue:51/255 alpha:0.5];
// leftView1.image = [UIImage imageNamed:@"icon_password.png"];
// textFieldPassWord.leftView = leftView1;
// textFieldPassWord.leftViewMode = UITextFieldViewModeAlways;
// leftView1.layer.cornerRadius = 5;
UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
button.frame = CGRectMake(((self.view.frame.size.width)-(self.view.frame.size.width-20))/2, 420, self.view.frame.size.width-20, 35);
[button setTitle:@"登录" forState:UIControlStateNormal];
button.titleLabel.font = [UIFont systemFontOfSize: 16.0];
button.layer.cornerRadius=5;
button.layer.masksToBounds = YES;
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[button setBackgroundImage:[UIImage imageNamed:@"1.png"] forState:UIControlStateNormal];
[self.view addSubview:button];
UIButton *button2 = [UIButton buttonWithType:UIButtonTypeSystem];
button2.frame = CGRectMake(((self.view.frame.size.width)-(self.view.frame.size.width-20))/2, 470, 70, 30);
[button2 setTitle:@"忘记密码" forState:UIControlStateNormal];
button2.titleLabel.font = [UIFont systemFontOfSize: 16.0];
button2.layer.cornerRadius=5;
button2.layer.masksToBounds = YES;
[button2 addTarget:self action:@selector(button2Action:) forControlEvents:UIControlEventTouchUpInside];
[button2 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
// UIBarButtonItem *backButtonItem = [[UIBarButtonItem alloc] init];
// backButtonItem.title = @"返回";
// self.navigationItem.backBarButtonItem = backButtonItem;
// self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:0 green:172.0f/255.0f blue:135.0f/255.0f alpha:1];
[self.view addSubview:button2];
UIButton *button1 = [UIButton buttonWithType:UIButtonTypeSystem];
button1.frame = CGRectMake(((self.view.frame.size.width)-(self.view.frame.size.width-20))/2, 525, self.view.frame.size.width-20, 35);
[button1 setTitle:@"现在注册拉钩" forState:UIControlStateNormal];
button1.titleLabel.font = [UIFont boldSystemFontOfSize:18];
button1.layer.cornerRadius=5;
button1.layer.masksToBounds = YES;
[button1 setTitleColor: [UIColor colorWithRed:0 green:172.0f/255.0f blue:135.0f/255.0f alpha:1] forState:UIControlStateNormal];
[button1 addTarget:self action:@selector(button1Action:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:button1];
UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0,self.view.bounds.size.height-85, self.view.bounds.size.width/2-30, 1.0f)];
lineView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:lineView];
UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake((self.view.frame.size.width)/2-15, 565, 30, 30)];
label1.text = @" or ";
label1.font = [UIFont systemFontOfSize:18];
label1.textColor = [UIColor whiteColor];
[self.view addSubview:label1];
UIView *lineView1 = [[UIView alloc] initWithFrame:CGRectMake((self.view.frame.size.width)/2+30,self.view.bounds.size.height-85, self.view.bounds.size.width/2-30, 1.0f)];
lineView1.backgroundColor = [UIColor whiteColor];
[self.view addSubview:lineView1];
UIButton *button3 = [UIButton buttonWithType:UIButtonTypeSystem];
button3.frame = CGRectMake(((self.view.frame.size.width)-(self.view.frame.size.width-20))/2, 600, self.view.frame.size.width-20, 35);
[button3 setTitle:@"随便逛逛>" forState:UIControlStateNormal];
button3.titleLabel.font = [UIFont systemFontOfSize: 16.0];
button3.layer.cornerRadius=5;
button3.layer.masksToBounds = YES;
[button3 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[self.view addSubview:button3];
}
- (void)button1Action:(UIButton *)button1 {
SetupViewController *setupViewController = [[SetupViewController alloc] init];
setupViewController.delegate = self;
setupViewController.textName = self.myinputView.usernameField.text;
setupViewController.textPassword = self.myinputView.passwordField.text;
[self.navigationController pushViewController:setupViewController animated:YES];
self.navigationController.navigationBarHidden = YES;
}
- (void)getTextField1:(NSString *)text1 TextField2:(NSString *)text2 {
self.myinputView.usernameField.text = text1;
self.myinputView.passwordField.text = text2;
}
- (void)button2Action:(UIButton *)button2 {
RemberViewController *remberViewController = [[RemberViewController alloc] init];
[self.navigationController pushViewController:remberViewController animated:YES];
self.navigationController.navigationBarHidden = NO;
}
//-(void)textFieldAction:(UITextField *)textFild{
// NSString *string = [[NSString alloc] init];
// string = 10005 == textFild.tag ? @"icon_password_select":@"icon_username_select";
// UIImageView *leftView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 41, 41)];
// leftView.backgroundColor = [UIColor colorWithRed:51/255 green:51/255 blue:51/255 alpha:0.6];
// leftView.image = [UIImage imageNamed:string];
// textFild.leftView = leftView;
// textFild.leftViewMode = UITextFieldViewModeAlways;
// leftView.layer.cornerRadius = 5;
// leftView.layer.masksToBounds = YES;
//
//}
//-(void)textFieldAction1:(UITextField *)textFild{
// NSString *string = [[NSString alloc] init];
// string = 10005 == textFild.tag ? @"icon_password":@"icon_username";
// UIImageView *leftView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 41, 41)];
// leftView.backgroundColor = [UIColor colorWithRed:51/255 green:51/255 blue:51/255 alpha:0.6];
// leftView.image = [UIImage imageNamed:string];
// textFild.leftView = leftView;
// textFild.leftViewMode = UITextFieldViewModeAlways;
// leftView.layer.cornerRadius = 5;
// leftView.layer.masksToBounds = YES;
//
//}
//
//-(void)textFieldActionp:(UITextField *)textFild{
// NSString *string = [[NSString alloc] init];
// string = 10005 == textFild.tag ? @"icon_username_select":@"icon_password_select";
// UIImageView *leftView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 41, 41)];
// leftView.backgroundColor = [UIColor colorWithRed:51/255 green:51/255 blue:51/255 alpha:0.6];
// leftView.image = [UIImage imageNamed:string];
// textFild.leftView = leftView;
// textFild.leftViewMode = UITextFieldViewModeAlways;
// leftView.layer.cornerRadius = 5;
// leftView.layer.masksToBounds = YES;
//
//
//}
//-(void)textFieldActionp1:(UITextField *)textFild{
// NSString *string = [[NSString alloc] init];
// string = 10005 == textFild.tag ? @"icon_username":@"icon_password";
// UIImageView *leftView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 41, 41)];
// leftView.backgroundColor = [UIColor colorWithRed:51/255 green:51/255 blue:51/255 alpha:0.6];
// leftView.image = [UIImage imageNamed:string];
// textFild.leftView = leftView;
// textFild.leftViewMode = UITextFieldViewModeAlways;
// leftView.layer.cornerRadius = 5;
// leftView.layer.masksToBounds = YES;
//}
- (UIImage *)image{
if (!_image) {
_image=[UIImage imageNamed:@"IMG_3527_meitu_5.jpg"];
}
return _image;
}
- (void)configImageTwo{
self.imageView=[[UIImageView alloc]initWithFrame:self.view.bounds];
self.imageView.contentMode=UIViewContentModeScaleAspectFill;
self.imageView.image=[UIImage boxblurImage:self.image withBlurNumber:0.5];
_imageView.alpha = 0.9;
self.imageView.clipsToBounds=YES;
[self.view addSubview:self.imageView];
}
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineCap(context, kCGLineCapRound);
CGContextSetLineWidth(context, 3); //线宽
CGContextSetAllowsAntialiasing(context, true);
CGContextSetRGBStrokeColor(context, 70.0 / 255.0, 241.0 / 255.0, 241.0 / 255.0, 1.0); //线的颜色
CGContextBeginPath(context);
CGContextMoveToPoint(context, 0, 0); //起点坐标
CGContextAddLineToPoint(context, 30, 30); //终点坐标
CGContextStrokePath(context);
}
- (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
//
// SetupViewController.h
// lagou
//
// Created by lanou3g on 17/8/7.
// Copyright © 2017年 lanou3g. All rights reserved.
//
#import
@protocol SetupViewControllerDelegate
- (void)getTextField1:(NSString *)text1 TextField2:(NSString *)text2;
@end
@interface SetupViewController : UIViewController
@property (nonatomic,retain) UIImage *image;
@property (nonatomic,retain) UIImageView *imageView;
//
@property (nonatomic, retain) NSString *textName;
@property (nonatomic, retain) NSString *textPassword;
@property (nonatomic,assign) iddelegate;
@end
//
// SetupViewController.m
// lagou
//
// Created by lanou3g on 17/8/7.
// Copyright © 2017年 lanou3g. All rights reserved.
//
#import "SetupViewController.h"
#import "MyInputView.h"
#import "UIImage+FEBoxBlur.h"
@interface SetupViewController ()
@property (nonatomic,retain) MyInputView *myinputView2;
@end
@implementation SetupViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self configImageTwo];
self.view.backgroundColor = [UIColor whiteColor];
UIImageView *topImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo_lagou.png"]];
CGFloat width = 110;
CGFloat height = 180;
topImageView.frame = CGRectMake((self.view.frame.size.width - width) / 2, 90, width, height);
[self.view addSubview:topImageView];
self.myinputView2 = [[MyInputView alloc] initWithFrame:CGRectMake(((self.view.frame.size.width)-(self.view.frame.size.width-20))/2, 300, self.view.frame.size.width-20, 102)];
self.myinputView2.userNameImageView.image = [UIImage imageNamed:@"phone1.png"];
self.myinputView2.userNameImageView.highlightedImage = [UIImage imageNamed:@"phone.png"];
self.myinputView2.usernameField.placeholder = @" 请输入手机号";
[self.myinputView2.usernameField setValue:[UIColor grayColor]forKeyPath:@"_placeholderLabel.textColor"];
[self.myinputView2.usernameField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];
self.myinputView2.userNameImageView.frame = CGRectMake(0, 0, 50, 50);
self.myinputView2.passwordImageView.image = [UIImage imageNamed:@"text11.png"];
self.myinputView2.passwordImageView.highlightedImage = [UIImage imageNamed:@"text.png"];
self.myinputView2.passwordField.placeholder = @" 请输入验证码";
[self.myinputView2.passwordField setValue:[UIColor grayColor]forKeyPath:@"_placeholderLabel.textColor"];
[self.myinputView2.passwordField setValue:[UIFont boldSystemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];
self.myinputView2.passwordImageView.frame = CGRectMake(0, 0, 50, 50);
[self.view addSubview:self.myinputView2];
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.frame = CGRectMake(0, 0, 100, 30);
[btn setTitle:@"获取验证码" forState:UIControlStateNormal];
[btn setTitleColor:[UIColor colorWithRed:0 green:172.0f/255.0f blue:135.0f/255.0f alpha:1] forState:UIControlStateNormal];
btn.titleLabel.font = [UIFont systemFontOfSize:15];
btn.backgroundColor = [UIColor clearColor];
self.myinputView2.passwordField.rightView = btn;
self.myinputView2.passwordField.rightViewMode = UITextFieldViewModeAlways;
CGFloat widthed = 225;
CGFloat heighted = 30;
UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake((self.view.frame.size.width-widthed-20)/2+20, 408, widthed, heighted)];
UIImageView *imageViewSetup = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"delegate.png"]];
imageViewSetup.frame = CGRectMake((self.view.frame.size.width-widthed-20)/2, 408, 20, 30);
[self.view addSubview:imageViewSetup];
label1.text = @"注册代表你同意拉钩用户协议";
label1.font = [UIFont boldSystemFontOfSize:16];
[self.view addSubview:label1];
NSMutableAttributedString *hintString=[[NSMutableAttributedString alloc]initWithString:label1.text];
NSRange range1=[[hintString string]rangeOfString:@"注册代表你同意"];
[hintString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:128.0f/255.0f green:138.0f/255.0f blue:135.0f/255.0f alpha:1] range:range1];
NSRange range2=[[hintString string]rangeOfString:@"拉钩用户协议"];
[hintString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:0 green:172.0f/255.0f blue:135.0f/255.0f alpha:1] range:range2];
label1.attributedText=hintString;
UIButton *buttonSetup = [UIButton buttonWithType:UIButtonTypeSystem];
buttonSetup.frame = CGRectMake(((self.view.frame.size.width)-(self.view.frame.size.width-20))/2, 465, self.view.frame.size.width-20, 45);
[buttonSetup setTitle:@"注册" forState:UIControlStateNormal];
[buttonSetup setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
buttonSetup.backgroundColor = [UIColor colorWithRed:0 green:172.0f/255.0f blue:135.0f/255.0f alpha:1];
buttonSetup.titleLabel.font = [UIFont systemFontOfSize:17];
buttonSetup.layer.cornerRadius = 3;
buttonSetup.layer.masksToBounds = YES;
[buttonSetup addTarget:self action:@selector(buttonBackAction:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:buttonSetup];
UIButton *buttonBack = [UIButton buttonWithType:UIButtonTypeCustom];
buttonBack.frame = CGRectMake(((self.view.frame.size.width)-(self.view.frame.size.width-20))/2, 530, self.view.frame.size.width-20, 45);
[buttonBack setTitle:@"返回登录" forState:UIControlStateNormal];
[buttonBack setTitleColor:[UIColor colorWithRed:0 green:172.0f/255.0f blue:135.0f/255.0f alpha:1] forState:UIControlStateNormal];
buttonBack.backgroundColor = [UIColor colorWithRed:0 green:172.0f/255.0f blue:135.0f/255.0f alpha:0.2];
buttonBack.layer.cornerRadius = 3;
buttonBack.titleLabel.font = [UIFont systemFontOfSize:17];
[buttonBack addTarget:self action:@selector(buttonBackAction:) forControlEvents:UIControlEventTouchUpInside];
buttonBack.layer.masksToBounds = YES;
buttonBack.layer.borderColor = [[UIColor colorWithRed:0 green:172.0f/255.0f blue:135.0f/255.0f alpha:1] CGColor];
buttonBack.layer.borderWidth = 1.f;
[self.view addSubview:buttonBack];
}
//- (void)buttonSetupAction:(UIButton *)buttonSetup {
//
//}
- (void)buttonBackAction:(UIButton *)buttonSetup {
[self.delegate getTextField1:self.myinputView2.usernameField.text TextField2:self.myinputView2.passwordField.text];
[self.navigationController popToRootViewControllerAnimated:YES];
self.navigationController.navigationBarHidden = YES;
}
- (UIImage *)image{
if (!_image) {
_image=[UIImage imageNamed:@"IMG_3527_meitu_5.jpg"];
}
return _image;
}
- (void)configImageTwo{
self.imageView=[[UIImageView alloc]initWithFrame:self.view.bounds];
self.imageView.contentMode=UIViewContentModeScaleAspectFill;
self.imageView.image=[UIImage boxblurImage:self.image withBlurNumber:0.5];
_imageView.alpha = 0.9;
self.imageView.clipsToBounds=YES;
[self.view addSubview:self.imageView];
}
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineCap(context, kCGLineCapRound);
CGContextSetLineWidth(context, 3); //线宽
CGContextSetAllowsAntialiasing(context, true);
CGContextSetRGBStrokeColor(context, 70.0 / 255.0, 241.0 / 255.0, 241.0 / 255.0, 1.0); //线的颜色
CGContextBeginPath(context);
CGContextMoveToPoint(context, 0, 0); //起点坐标
CGContextAddLineToPoint(context, 30, 30); //终点坐标
CGContextStrokePath(context);
}
- (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
//
// RemberViewController.m
// lagou
//
// Created by lanou3g on 17/8/7.
// Copyright © 2017年 lanou3g. All rights reserved.
//
#import "RemberViewController.h"
#import "textView.h"
@interface RemberViewController ()
@end
@implementation RemberViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor whiteColor];
self.navigationController.navigationBar.translucent = YES;
[self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setShadowImage:[[UIImage alloc] init]];
// UIButton *backButton = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 40, 30)];
// [backButton setTitle:@"返回" forState:UIControlStateNormal];
// [backButton setTitleColor:[UIColor colorWithRed:0 green:172.0f/255.0f blue:135.0f/255.0f alpha:1] forState:UIControlStateNormal];
// [backButton addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
// self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:0 green:172.0f/255.0f blue:135.0f/255.0f alpha:1];
// self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:backButton];
CGFloat width = 100;
CGFloat height = 50;
UILabel *labelTitle = [[UILabel alloc] initWithFrame:CGRectMake((self.view.frame.size.width-100)/2, 60, width, height)];
labelTitle.text = @"验证手机";
labelTitle.textAlignment = NSTextAlignmentCenter;
labelTitle.font = [UIFont systemFontOfSize:18];
[self.view addSubview:labelTitle];
textView *textsView = [[textView alloc] initWithFrame:CGRectMake(((self.view.frame.size.width)-(self.view.frame.size.width-40))/2, 120, self.view.frame.size.width-40, 92)];
// textsView.backgroundColor = [UIColor redColor];
[self.view addSubview:textsView];
UIButton *nextButton = [UIButton buttonWithType:UIButtonTypeSystem];
nextButton.frame = CGRectMake((self.view.frame.size.width-(self.view.frame.size.width-40))/2, 240, self.view.frame.size.width-40, 45);
[nextButton setTitle:@"下一步" forState:UIControlStateNormal];
nextButton.backgroundColor = [UIColor colorWithRed:0 green:172.0f/255.0f blue:135.0f/255.0f alpha:1];
nextButton.layer.cornerRadius = 3;
nextButton.layer.masksToBounds = YES;
[nextButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[self.view addSubview:nextButton];
CGFloat widthed = 225;
CGFloat heighted = 30;
UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake((self.view.frame.size.width-(self.view.frame.size.width-40))/2, 300, widthed, heighted)];
label1.text = @"邮箱用户找回密码,请点击这里";
label1.font = [UIFont boldSystemFontOfSize:14];
[self.view addSubview:label1];
NSMutableAttributedString *hintString=[[NSMutableAttributedString alloc]initWithString:label1.text];
NSRange range1=[[hintString string]rangeOfString:@"邮箱用户找回密码,请"];
[hintString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:128.0f/255.0f green:138.0f/255.0f blue:135.0f/255.0f alpha:0.3] range:range1];
NSRange range2=[[hintString string]rangeOfString:@"点击这里"];
[hintString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:0 green:172.0f/255.0f blue:135.0f/255.0f alpha:1] range:range2];
label1.attributedText=hintString;
}
//-(void)backAction{
// [self.navigationController popViewControllerAnimated:YES];
// self.navigationController.navigationBarHidden = YES;
//}
- (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
//
// MyInputView.h
// lagou
//
// Created by lanou3g on 17/8/7.
// Copyright © 2017年 lanou3g. All rights reserved.
//
#import
@interface MyInputView : UIView
@property (nonatomic, retain) UITextField *usernameField;
@property (nonatomic, retain) UITextField *passwordField;
@property (nonatomic, retain) UIImageView *userNameImageView;
@property (nonatomic, retain) UIImageView *passwordImageView;
@end
//
// MyInputView.m
// lagou
//
// Created by lanou3g on 17/8/7.
// Copyright © 2017年 lanou3g. All rights reserved.
//
#import "MyInputView.h"
@interface MyInputView ()
@end
@implementation MyInputView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
self.userNameImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_username.png"] highlightedImage:[UIImage imageNamed:@"icon_username_select.png"]];
self.userNameImageView.frame = CGRectMake(0, 0, 40, 40);
self.userNameImageView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.6f];
self.passwordImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_password.png"] highlightedImage:[UIImage imageNamed:@"icon_password_select.png"]];
self.passwordImageView.frame = CGRectMake(0, 0, 40, 40);
self.passwordImageView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.6f];
self.usernameField = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height/2-1)];
self.usernameField.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.3];
self.usernameField.clearButtonMode = YES;
self.usernameField.delegate = self;
[self addSubview:self.usernameField];
self.passwordField = [[UITextField alloc] initWithFrame:CGRectMake(0, self.usernameField.frame.size.height+2, self.usernameField.frame.size.width, self.usernameField.frame.size.height)];
self.passwordField.secureTextEntry = YES;
self.passwordField.clearButtonMode = YES;
self.passwordField.delegate = self;
self.passwordField.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.3];
[self addSubview:self.passwordField];
self.usernameField.leftView = self.userNameImageView;
self.usernameField.leftViewMode = UITextFieldViewModeAlways;
[self addSubview:self.userNameImageView];
self.passwordField.leftView = self.passwordImageView;
self.passwordField.leftViewMode = UITextFieldViewModeAlways;
[self addSubview:self.passwordImageView];
}
return self;
}
//代理方法
- (void)textFieldDidBeginEditing:(UITextField *)textField {
UIImageView *leftView = (UIImageView *)textField.leftView;
leftView.highlighted = YES;
}
- (void)textFieldDidEndEditing:(UITextField *)textField {
UIImageView *leftView = (UIImageView *)textField.leftView;
leftView.highlighted = NO;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
//
// textView.h
// lagou
//
// Created by apple on 2017/8/7.
// Copyright © 2017年 lanou3g. All rights reserved.
//
#import
@interface textView : UIView
@property (nonatomic, retain) UITextField *phoneNumberTextField;
@property (nonatomic, retain) UITextField *textNumberTextField;
@property (nonatomic, retain) UIImageView *imageView;
@property (nonatomic, retain) UIImageView *imageView1;
@property (nonatomic, retain) UIImageView *phoneNumberImageView;
@property (nonatomic, retain) UIImageView *textNumberImageView;
@end
//
// textView.m
// lagou
//
// Created by apple on 2017/8/7.
// Copyright © 2017年 lanou3g. All rights reserved.
//
#import "textView.h"
@interface textView ()
@end
@implementation textView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
self.phoneNumberTextField = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height/2 - 1)];
self.phoneNumberTextField.placeholder = @" 手机号(仅支持中国大陆手机号)";
self.phoneNumberTextField.font = [UIFont systemFontOfSize:15];
self.phoneNumberTextField.clearButtonMode = YES;
self.phoneNumberTextField.delegate = self;
[self addSubview:self.phoneNumberTextField];
self.textNumberTextField = [[UITextField alloc] initWithFrame:CGRectMake(0, self.phoneNumberTextField.frame.size.height+2, frame.size.width, frame.size.height/2 - 1)];
self.textNumberTextField.placeholder = @" 验证码";
self.textNumberTextField.font = [UIFont systemFontOfSize:15];
self.textNumberTextField.secureTextEntry = YES;
self.textNumberTextField.clearButtonMode = YES;
self.textNumberTextField.delegate = self;
[self addSubview:self.textNumberTextField];
self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, self.phoneNumberTextField.frame.size.height, frame.size.width, 1)];
self.imageView.backgroundColor = [UIColor colorWithRed:128.0f/255.0f green:138.0f/255.0f blue:135.0f/255.0f alpha:0.2];
[self addSubview:self.imageView];
self.imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 93, frame.size.width, 1)];
self.imageView1.backgroundColor = [UIColor colorWithRed:128.0f/255.0f green:138.0f/255.0f blue:135.0f/255.0f alpha:0.2];
[self addSubview:self.imageView1];
self.phoneNumberImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"phone1.png"] highlightedImage:[UIImage imageNamed:@"phone.png"]];
self.phoneNumberImageView.frame = CGRectMake(0, 0, 25, 25);
self.phoneNumberImageView.backgroundColor = [UIColor whiteColor];
self.textNumberImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"text1.png"] highlightedImage:[UIImage imageNamed:@"text.png"]];
self.textNumberImageView.frame = CGRectMake(0, 0, 21, 25);
self.textNumberImageView.backgroundColor = [UIColor whiteColor];
self.phoneNumberTextField.leftView = self.phoneNumberImageView;
self.phoneNumberTextField.leftViewMode = UITextFieldViewModeAlways;
[self addSubview:self.phoneNumberImageView];
self.textNumberTextField.leftView = self.textNumberImageView;
self.textNumberTextField.leftViewMode = UITextFieldViewModeAlways;
UIButton *textButton = [UIButton buttonWithType:UIButtonTypeSystem];
textButton.frame = CGRectMake(0, 0, 100, 30);
[textButton setTitle:@"获取验证码" forState:UIControlStateNormal];
[textButton setTitleColor:[UIColor colorWithRed:0 green:172.0f/255.0f blue:135.0f/255.0f alpha:1] forState:UIControlStateNormal];
self.textNumberTextField.rightView = textButton;
self.textNumberTextField.rightViewMode = UITextFieldViewModeAlways;
[self addSubview:self.textNumberImageView];
}
return self;
}
- (void)textFieldDidBeginEditing:(UITextField *)textField {
UIImageView *leftView = (UIImageView *)textField.leftView;
leftView.highlighted = YES;
}
- (void)textFieldDidEndEditing:(UITextField *)textField {
UIImageView *leftView = (UIImageView *)textField.leftView;
leftView.highlighted = NO;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Menlo; color: #008400}p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Menlo; color: #1337ff}p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Menlo; min-height: 19.0px}p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Menlo; color: #d12f1b}p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Menlo}p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Menlo; color: #bb2ca2}span.s1 {font-variant-ligatures: no-common-ligatures}span.s2 {font-variant-ligatures: no-common-ligatures; color: #008400}span.s3 {font-variant-ligatures: no-common-ligatures; color: #1337ff}span.s4 {font: 16.0px 'PingFang SC'; font-variant-ligatures: no-common-ligatures}span.s5 {font-variant-ligatures: no-common-ligatures; color: #78492a}span.s6 {font-variant-ligatures: no-common-ligatures; color: #bb2ca2}span.s7 {font-variant-ligatures: no-common-ligatures; color: #703daa}
//
// UIImage+FEBoxBlur.h
// iOS-UIImageBoxBlur
//http://indieambitions.com/idevblogaday/perform-blur-vimage-accelerate-framework-tutorial/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+IndieAmbitions+%28Indie+Ambitions%29
// Created by keso on 16/1/14.
// Copyright © 2016年 FlyElephant. All rights reserved.
//
#import
#import
@interface UIImage (FEBoxBlur)
/**
* CoreImage图片高斯模糊
*
* @param image 图片
* @param blur 模糊数值(默认是10)
*
* @return 重新绘制的新图片
*/
+(UIImage *)coreBlurImage:(UIImage *)image withBlurNumber:(CGFloat)blur;
/**
* vImage模糊图片
*
* @param image 原始图片
* @param blur 模糊数值(0-1)
*
* @return 重新绘制的新图片
*/
+(UIImage *)boxblurImage:(UIImage *)image withBlurNumber:(CGFloat)blur;
@end
//
// UIImage+FEBoxBlur.m
// iOS-UIImageBoxBlur
//
// Created by keso on 16/1/14.
// Copyright © 2016年 FlyElephant. All rights reserved.
//
#import "UIImage+FEBoxBlur.h"
@implementation UIImage (FEBoxBlur)
+(UIImage *)coreBlurImage:(UIImage *)image
withBlurNumber:(CGFloat)blur {
//博客园-FlyElephant
CIContext *context = [CIContext contextWithOptions:nil];
CIImage *inputImage=[CIImage imageWithCGImage:image.CGImage];
//设置filter
CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur"];
[filter setValue:inputImage forKey:kCIInputImageKey];
[filter setValue:@(blur) forKey: @"inputRadius"];
//模糊图片
CIImage *result=[filter valueForKey:kCIOutputImageKey];
CGImageRef outImage=[context createCGImage:result fromRect:[result extent]];
UIImage *blurImage=[UIImage imageWithCGImage:outImage];
CGImageRelease(outImage);
return blurImage;
}
+(UIImage *)boxblurImage:(UIImage *)image withBlurNumber:(CGFloat)blur {
if (blur < 0.f || blur > 1.f) {
blur = 0.5f;
}
int boxSize = (int)(blur * 40);
boxSize = boxSize - (boxSize % 2) + 1;
CGImageRef img = image.CGImage;
vImage_Buffer inBuffer, outBuffer;
vImage_Error error;
void *pixelBuffer;
//从CGImage中获取数据
CGDataProviderRef inProvider = CGImageGetDataProvider(img);
CFDataRef inBitmapData = CGDataProviderCopyData(inProvider);
//设置从CGImage获取对象的属性
inBuffer.width = CGImageGetWidth(img);
inBuffer.height = CGImageGetHeight(img);
inBuffer.rowBytes = CGImageGetBytesPerRow(img);
inBuffer.data = (void*)CFDataGetBytePtr(inBitmapData);
pixelBuffer = malloc(CGImageGetBytesPerRow(img) *
CGImageGetHeight(img));
if(pixelBuffer == NULL)
NSLog(@"No pixelbuffer");
outBuffer.data = pixelBuffer;
outBuffer.width = CGImageGetWidth(img);
outBuffer.height = CGImageGetHeight(img);
outBuffer.rowBytes = CGImageGetBytesPerRow(img);
error = vImageBoxConvolve_ARGB8888(&inBuffer, &outBuffer, NULL, 0, 0, boxSize, boxSize, NULL, kvImageEdgeExtend);
if (error) {
NSLog(@"error from convolution %ld", error);
}
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef ctx = CGBitmapContextCreate(
outBuffer.data,
outBuffer.width,
outBuffer.height,
8,
outBuffer.rowBytes,
colorSpace,
kCGImageAlphaNoneSkipLast);
CGImageRef imageRef = CGBitmapContextCreateImage (ctx);
UIImage *returnImage = [UIImage imageWithCGImage:imageRef];
//clean up
CGContextRelease(ctx);
CGColorSpaceRelease(colorSpace);
free(pixelBuffer);
CFRelease(inBitmapData);
CGColorSpaceRelease(colorSpace);
CGImageRelease(imageRef);
return returnImage;
}
@end