跳转

作者: b6e7b0be2603 | 来源:发表于2019-03-07 10:27 被阅读0次

返回按钮

  //文本样式的按钮

        lettextbtn =UIButton.init(type: .system)

        textbtn.frame=CGRect.init(x: 0, y: 0, width: 80, height: 30)

        textbtn.center=CGPoint.init(x:ScrW/2, y: 200)

        textbtn.setTitleColor(.blue, for: .normal)

        textbtn.setTitle("返回按钮", for: .normal)

        textbtn.addTarget(self, action:#selector(textbtnDid(sender:)), for: .touchUpInside)

        self.view.addSubview(textbtn)

//触发方法

@objcfunctextbtnDid(sender:UIButton) ->Void{

        self.dismiss(animated:true, completion:nil)

    }

//进入方法

// 按钮触发事件

    @IBActionfuncbtnDidPress(_sender:Any) {

        self.myLabel.text="北京欢迎您"

        // 跳转到Draw控制器

        letdrawVC =DrawViewController()

        self.present(drawVC, animated:true, completion:nil)

    }

相关文章

网友评论

      本文标题:跳转

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