iOS mimic QQ Landing interface

Source: Internet
Author: User


We recommend two learning addresses:

Geek's College Video: http://www.jikexueyuan.com/path/ios/

A blog: http://blog.csdn.net/lizhongfu2013/article/details/29210015


The main want to achieve a mock landing interface

Code:

loginviewcontroller.swift//ibm_login////Created by Dcintern on 6/26/15.//Copyright (c) dcintern. All rights reserved.////import Foundationimport Uikitclass loginviewcontroller:uiviewcontroller{//define attribute var QQNumber = Uitextfield () var passnumber = Uitextfield () override Func Viewdidload () {Self.view.backgroundColor = Uicolor.whit EColor () Super.viewdidload ()//Add head picture [self. addallsubviews ()];} Add all child controls Func addallsubviews () {///tile background var headimage = Uiimageview (Frame:cgrectmake (0,0, +,)) Headi Mage.image = UIImage (named: "123.jpeg") Self.view.addSubview (Headimage)//QQ number input hint, temporarily not used var phonetext = UI Label (Frame:cgrectmake (), Uiscreen.mainscreen () bounds.size.width-60, ()) Phonetext.text = "" Self.view.addS Ubview (Phonetext)///QQ number input box var qqnumber = Uitextfield (Frame:cgrectmake (+, Uiscreen.mainscreen (). Bounds. size.width-60) Qqnumber.placeholder = "username" qqnumber.layer.bOrderwidth = 2 QQNumber.layer.borderColor = Uicolor.lightgraycolor (). Cgcolor QQNumber.layer.cornerRadius = 5 Qqnumber.keyboardtype = Uikeyboardtype.numberpad Self.view.addSubview (qqn umber) self. Qqnumber = qqnumber//password input hint, temporarily useless to var passtext = UILabel (Frame:cgrectmake (). Uiscreen.mainscreen nds.size.width-60) Passtext.text = "" Self.view.addSubview (passtext)//Password input box var passnumber = Uitex Tfield (Frame:cgrectmake (), Uiscreen.mainscreen (), bounds.size.width-60, () Passnumber.placeholder = "Password "PassNumber.layer.borderWidth = 2 PassNumber.layer.borderColor = Uicolor.lightgraycolor (). Cgcolor PassNumber.layer.cornerRadius = 5 Self.view.addSubview (passnumber) self. Passnumber = passnumber///password back var button = UIButton (Frame:cgrectmake ($, I, +)) uibutton.buttonw Ithtype (Uibuttontype.custom) button.settitle ("Forgot password", forState:UIControlState.Normal) Button.settitlecolor (uicolOr.lightgraycolor (), ForState:UIControlState.Normal) Self.view.addSubview (button) Button.addtarget (Self, Action: "O Nclick ", forControlEvents:UIControlEvents.TouchUpInside)}///Password retrieval method implementation Func OnClick () {///Retrieve password hint Uialertview ( Title: "Warm Prompt", message: "New password has been sent to the phone", Delegate:nil, Cancelbuttontitle: "OK", Otherbuttontitles: "Cancel"). Show ()}/** Click on the interface keyboard to resign from the first responder */override func Touchesbegan (Touches:nsset, withevent event:uievent) {self. Qqnumber.resignfirstresponder () self. Passnumber.resignfirstresponder ()}}


iOS mimic QQ Landing interface

Related Article

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.