Ios--app Login Interface Diagram (Xuer)

Source: Internet
Author: User

ViewController.h

#import "ViewController.h"@interfaceViewcontroller () @property (strong,nonatomic) Uiimageview*Beijing, @property (strong,nonatomic) Uiimageview*Welcome, @property (strong,nonatomic) Uiimageview*Phoneicon, @property (strong,nonatomic) Uitextfield*Intele, @property (strong,nonatomic) UIView*Inteleview, @property (strong,nonatomic) Uiimageview*Passwordicon, @property (strong,nonatomic) Uitextfield*Inpassword, @property (strong,nonatomic) UIView*Inpasswordview, @property (strong,nonatomic) Uiimageview*logo; @property (strong,nonatomic) UIButton*Loginbutton, @property (strong,nonatomic) UIButton*Rigisterbutton;@end

Viewcontroller.m

@implementationViewcontroller- (void) viewdidload {[Super viewdidload]; //Add parent View Beijing background mapSelf.beijing=[[uiimageview Alloc] Initwithframe:cgrectmake (0,0, Self.view.frame.size.width, Self.view.frame.size.height)]; //Insert Picture[Self.beijing setimage:[uiimage imagenamed:@"Beijing"]];        [Self.view addSubview:self.beijing]; //Add a child view welcome background mapSelf.welcome=[[uiimageview Alloc] Initwithframe:cgrectmake ( $, $,318, -)]; //Insert Picture[Self.welcome setimage:[uiimage imagenamed:@"Welcome"]]; //Insert Child View[Self.view AddSubview:self.welcome]; //add Phoneicon input iconSelf.phoneicon=[[uiimageview Alloc] Initwithframe:cgrectmake ( the,122, -, -)]; //Insert Picture[Self.phoneicon setimage:[uiimage imagenamed:@"Phoneicon"]];        [Self.view AddSubview:self.phoneIcon]; //Add phone number input boxSelf. Intele=[[uitextfield Alloc] Initwithframe:cgrectmake ( About,122,267, +)]; //Set Stealth WordsSelf. Intele.placeholder=@"Please enter your mobile phone number"; //setting up a numeric pop-up keyboardSelf. Intele.keyboardtype=Uikeyboardtypenumberpad; //set the Uitextfield without BordersSelf. intele.borderstyle=Uitextborderstylenone; [Self.view addsubview:self.    Intele]; Self. Inteleview=[[uiview Alloc] Initwithframe:cgrectmake ( the, the, -,1)]; Self. Inteleview.backgroundcolor=[Uicolor Whitecolor]; [Self.view addsubview:self.            Inteleview]; //Add password entry boxSelf. Inpassword=[[uitextfield Alloc] Initwithframe:cgrectmake ( About,182,267, +)]; Self. Inpassword.placeholder=@"Please enter your password"; Self. Inpassword.securetextentry=YES; Self. Inpassword.borderstyle=Uitextborderstylenone; [Self.view addsubview:self.        Inpassword]; Self. Inpasswordview=[[uiview Alloc] Initwithframe:cgrectmake ( the,213, -,1)]; Self. Inpasswordview.backgroundcolor=[Uicolor Whitecolor]; [Self.view addsubview:self.        Inpasswordview]; //add Passwordicon input iconSelf.passwordicon=[[uiimageview Alloc] Initwithframe:cgrectmake ( the,182, -, -)]; [Self.passwordicon setimage:[uiimage imagenamed:@"Passwordicon"]];        [Self.view AddSubview:self.passwordIcon]; //Add logo background imageSelf.logo=[[uiimageview Alloc] Initwithframe:cgrectmake (173,694, the, A)]; [Self.logo setimage:[uiimage imagenamed:@"logo"]];        [Self.view AddSubview:self.logo]; //settings related to the login buttonSelf.loginbutton=[[uibutton Alloc] Initwithframe:cgrectmake ( the,282,318, -)]; [Self.loginbutton setbackgroundimage:[uiimage imagenamed:@"Loginbutton"] Forstate:uicontrolstatenormal]; [Self.loginbutton settitle:@"Login"Forstate:uicontrolstatenormal]; //Event Monitoring[Self.loginbutton addtarget:self Action: @selector (Hidekeyboard) forcontrolevents:uicontroleventtouchupinside]    ;        [Self.view AddSubview:self.loginButton]; //Registration button SettingsSelf.rigisterbutton=[[uibutton Alloc] Initwithframe:cgrectmake ( the,338,318, -)]; [Self.rigisterbutton setbackgroundimage:[uiimage imagenamed:@"Rigisterbutton"] Forstate:uicontrolstatenormal]; [Self.rigisterbutton settitle:@"Register"Forstate:uicontrolstatenormal]; //Event Monitoring[Self.rigisterbutton addtarget:self Action: @selector (Hidekeyboard) forControlEvents:    UIControlEventTouchUpInside];    [Self.rigisterbutton Settitlecolor:[uicolor Greencolor] forstate:uicontrolstatenormal];    [Self.view AddSubview:self.rigisterButton]; }//Click the blank area to hide the keyboard-(void) Touchesbegan: (Nsset<uitouch *> *) touches withevent: (Uievent *)Event{[self hidekeyboard];}-(void) hidekeyboard{if([Self. Intele isfirstresponder]| |[Self. Inpassword Isfirstresponder]) {[Self.        Intele Resignfirstresponder]; [Self.    Inpassword Resignfirstresponder]; }    }

Operation Result:

Ios--app Login Interface Diagram (Xuer)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.