zoukankan      html  css  js  c++  java
  • 登录 ,注册 界面实现 代码

        

        //1、账号标签

        UILabel *idLalel = [[UILabel alloc] initWithFrame:CGRectMake(30, 100, 70, 30)];

        //2、设置⽂文本控制相关的属性

        idLalel.text = @"账号:";

        [self addSubview:idLalel];

        [idLalel release];

        

        

        //1、密码标签

        UILabel *passLalel = [[UILabel alloc] initWithFrame:CGRectMake(30, 200, 70, 30)];

        //2、设置⽂文本控制相关的属性

        passLalel.text = @"密码:";

        [self addSubview:passLalel];

        [passLalel release];

        

        

        //账号输入框

        UITextField *idTexfield = [[UITextField alloc] initWithFrame:CGRectMake(100, 100, 160, 30)];

        //设置边界属性

        idTexfield.tag = 1001;

        idTexfield.borderStyle = UITextBorderStyleBezel;

        idTexfield.placeholder = @"请输入账号...";

        idTexfield.delegate = self;

        [self addSubview:idTexfield];

        [idTexfield release];

        

        

        //密码输入框

        UITextField *passTexfield = [[UITextField alloc] initWithFrame:CGRectMake(100, 200, 160, 30)];

        //设置边界属性

        passTexfield.tag = 1002;

        passTexfield.borderStyle = UITextBorderStyleBezel;

        passTexfield.secureTextEntry = YES;   //以圆点形式输入

        passTexfield.keyboardType =  UIKeyboardTypeNumberPad;//键盘形式

        passTexfield.returnKeyType = UIReturnKeyNext;

        passTexfield.placeholder = @"请输入密码...";

        passTexfield.delegate = self;

        

        [self addSubview:passTexfield];

        [passTexfield release];

        

        

        //放置按钮

        //登录

        UIButton *loginButton = [UIButton buttonWithType:UIButtonTypeSystem];

        loginButton.frame = CGRectMake(30, 250, 60, 30);

        [loginButton setTitle:@"登录" forState:UIControlStateNormal];

        //添加事件

        [loginButton addTarget:self action:@selector(loginAction:)

              forControlEvents:UIControlEventTouchUpInside];

        [self addSubview:loginButton];

        

        //注册

        UIButton *registerButton = [UIButton buttonWithType:UIButtonTypeSystem];

        registerButton.frame = CGRectMake(120, 250, 60, 30);

        [registerButton setTitle:@"注册" forState:UIControlStateNormal];

        // [loginButton addTarget:self action:@selector(login:)

        //       forControlEvents:UIControlEventTouchUpInside];

        [self addSubview:registerButton];

        

        //密码找回

        UIButton *regetButton = [UIButton buttonWithType:UIButtonTypeSystem];

        regetButton.frame = CGRectMake(220, 250, 60, 30);

        [regetButton setTitle:@"密码找回" forState:UIControlStateNormal];

        // [loginButton addTarget:self action:@selector(login:)

        //       forControlEvents:UIControlEventTouchUpInside];

        [self addSubview:regetButton];

        

        

  • 相关阅读:
    git三种模式及常用命令
    git remote
    页面中添加qq客服
    用ubuntu里的vim搭建一个apache2+php+mysql环境一路踩的坑
    jQuery无new创建对象原理
    国崛战略
    计算机公开课推荐 2019.8
    Unable to preventDefault inside passive event listener due to target being treated as passive 怎么办?
    VUE事件修饰符.passive、.capture、.once实现原理——重新认识addEventListener方法
    看各类框架源码淘来的一些JavaScript技巧
  • 原文地址:https://www.cnblogs.com/iOS-mt/p/4141019.html
Copyright © 2011-2022 走看看