美文网首页
登录,注册页面

登录,注册页面

作者: 张皓男 | 来源:发表于2016-11-21 18:34 被阅读0次

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

// Override point for customization after application launch.

self.window = UIWindow(frame:UIScreen.main.bounds)

self.window?.backgroundColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)

self.window?.makeKeyAndVisible()

self.window?.rootViewController = UIViewController()

let ImageView = UIImageView(frame:CGRect(x: 157, y: 20, width: 100, height: 100))

ImageView.image = #imageLiteral(resourceName: "a.jpeg")

ImageView.layer.cornerRadius = 50

ImageView.layer.masksToBounds = true

self.window?.addSubview(ImageView)

let Lable = UILabel(frame:CGRect(x: 50, y: 140, width: 50, height: 40))

Lable.text = "账号"

Lable.backgroundColor = #colorLiteral(red: 0.9880268512, green: 0.9258960921, blue: 1, alpha: 1)

Lable.layer.cornerRadius = 10

Lable.layer.masksToBounds = true

self.window?.addSubview(Lable)

Lable.tag = 200

let textField = UITextField(frame:CGRect(x: 120, y: 140, width: 264, height: 40))

textField.backgroundColor = #colorLiteral(red: 0.8976129821, green: 0.6902934195, blue: 0.9686274529, alpha: 1)

textField.borderStyle = .roundedRect

textField.placeholder = "请输入账号"

textField.clearsOnBeginEditing = true

textField.keyboardType = .emailAddress

textField.layer.cornerRadius = 10

textField.layer.masksToBounds = true

self.window?.addSubview(textField)

let Lable2 = UILabel(frame:CGRect(x: 50, y: 200, width: 50, height: 40))

Lable2.text = "密码"

Lable2.backgroundColor = #colorLiteral(red: 0.9880268512, green: 0.9258960921, blue: 1, alpha: 1)

Lable2.layer.cornerRadius = 10

Lable2.layer.masksToBounds = true

self.window?.addSubview(Lable2)

Lable2.tag = 200

let textField2 = UITextField(frame:CGRect(x: 120, y: 200, width: 264, height: 40))

textField2.backgroundColor = #colorLiteral(red: 0.8976129821, green: 0.6902934195, blue: 0.9686274529, alpha: 1)

textField2.layer.cornerRadius = 10

textField2.layer.masksToBounds = true

textField2.borderStyle = .roundedRect

textField2.placeholder = "请输入密码"

textField2.clearsOnBeginEditing = true

textField2.keyboardType = .emailAddress

textField2.isSecureTextEntry = true

self.window?.addSubview(textField2)

let button = UIButton(frame:CGRect(x: 50, y: 260, width: 50, height: 40))

button.setTitle("登录", for: .normal)

button.backgroundColor = #colorLiteral(red: 0.922887975, green: 0.7753175045, blue: 1, alpha: 1)

button.layer.cornerRadius = 10

button.clipsToBounds = true

self.window?.addSubview(button)

button.addTarget(self, action: #selector(buttonAction), for: .touchUpInside)

let Button2 = UIButton(type: .custom)

Button2.setTitle("注册", for: .normal)

Button2.backgroundColor = #colorLiteral(red: 0.922887975, green: 0.7753175045, blue: 1, alpha: 1)

Button2.layer.cornerRadius = 10

Button2.clipsToBounds = true

Button2.frame = CGRect(x: 330, y: 260, width: 50, height: 40)

self.window?.addSubview(Button2)

Button2.addTarget(self, action: #selector(Button2Action), for: .touchUpInside)

return true

}

// MARK:- button的点击事件

func buttonAction()  {

print("登录成功")

}

// MARK:- playButton的点击事件

func Button2Action(button:UIButton)  {

print("注册成功")

}

相关文章

  • 2019-07-18

    我的简单的登录注册页面练习1.登录页面 登录页面练习 2.注册页面

  • 注册和登录(关于Cookie)

    需求 我希望用户能够注册 ->注册后跳转到登录页面 -> 登录页面跳转以后跳转到首页显示我的登录密码 注册页面 前...

  • 注册 && 登录

    registration.html -- 注册页面 login.html -- 登录页面 注册和登录页面里的aja...

  • Java写图书管理系统(二、注册页面)

    上篇我们写了登录页面,没账号怎么登录呢?肯定就需要注册页面啦~~~~~~ 二、注册页面( 若注册信息没有填写完整,...

  • 浅谈一次登录注册与cookie

    需求 我希望用户能够注册 ->注册后跳转到登录页面 -> 登录页面跳转以后跳转到首页显示我的登录密码 完成效果 代...

  • 六、url链接

    1.页面跳转 在网站中我们经常会遇到,页面跳转的情况,比如点击登录,可以跳转到登录页面,点击注册可以跳转到注册页面...

  • IM社交App02

    阅读原文 注册 登录 3.3 功能三:主页面 页面布局 主界面代码 3.4 功能四:设置页面 页面布局 退出登录 ...

  • 吃货必备

    登录注册页面 首页-发现 首页-美食榜 动态页面 我的页面

  • 项目登录

    1.登录 ⑴如果有账号,直接登录,没有进入注册页面;如果登录过直接进主页面,如果没有进入登录页面; ⑵第三方登录拿...

  • 测试平台系列(10) 编写注册页面

    编写注册页面 回顾 上一节课我们已经编写好了登录页面,用户也可以正常登录了,不过我们不能让用户不能注册呀,而且注册...

网友评论

      本文标题:登录,注册页面

      本文链接:https://www.haomeiwen.com/subject/zgiupttx.html