swfit登录耶

//AppDelegate里面

    let tt = TTViewController() 
    self.window?.rootViewController=UINavigationController (rootViewController: tt)

//TTViewController里面

  self.navigationItem.title="会员注册"
    
    let item1 = UIBarButtonItem(title: "<", style: UIBarButtonItemStyle.plain, target: self, action: nil)        
    self.navigationItem.leftBarButtonItem=item1
    self.view.backgroundColor=UIColor.lightGray
    
    let img = UIImageView.init(frame: CGRect(x: 150, y: 100, width: 100, height: 100))   
    img.image=UIImage.init(named: "touxiang")        
    img.layer.cornerRadius=50
    img.layer.masksToBounds=true
    self.view.addSubview(img)
    
    let textF = UITextField.init(frame: CGRect(x: 0, y: 210, width: self.view.frame.size.width, height: 40))
    textF.placeholder="请输入手机号"
    textF.backgroundColor=UIColor.white
    textF.keyboardType = UIKeyboardType.numberPad
    self.view.addSubview(textF)
    
    let textF1 = UILabel.init(frame: CGRect(x: 0, y: 251, width: self.view.frame.size.width, height: 40))
    textF1.backgroundColor=UIColor.white
    
    let imga = UIImageView.init(frame: CGRect(x: 10, y:0 , width: 100, height: 40))
    imga.image=UIImage.init(named: "touxiang")
    textF1.addSubview(imga)  
    self.view.addSubview(textF1)
    
    let textF2 = UITextField.init(frame: CGRect(x: 0, y: 292, width: self.view.frame.size.width, height: 40))
    textF2.placeholder="请输入手机号"
    textF2.backgroundColor=UIColor.white
    textF2.isSecureTextEntry = true
    self.view.addSubview(textF2)
    
    let but = UIButton.init(frame: CGRect(x: 50, y: 350, width: 300, height: 40))  
    but.setTitle("登录", for: .normal)
    but.backgroundColor=UIColor.blue
    but.layer.cornerRadius=10
    but.layer.masksToBounds=true
    self.view.addSubview(but)
    
    let but1 = UIButton.init(frame: CGRect(x: 200, y: 400, width: 80, height: 40))       
    but1.setTitle("已有账号", for: .normal)
    self.view.addSubview(but1)
    
    let but2 = UIButton.init(frame: CGRect(x: 280, y: 400, width: 80, height: 40))
    but2.setTitle("登录", for: .normal)
    self.view.addSubview(but2)
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。