当前位置: 移动技术网 > IT编程>移动开发>IOS > ios开发swift TextView

ios开发swift TextView

2018年10月05日  | 移动技术网IT编程  | 我要评论

但斌的博客,攀岩运动,迪斯尼公主装

let textview = uitextview(frame:cgrect(x:10,y:10,width:100,height:100));
        //设置边框粗细
        textview.layer.borderwidth = 1;
        //边框颜色
        textview.layer.bordercolor = uicolor.gray.cgcolor;
        self.view .addsubview(textview);

        //是否可编辑
        textview.iseditable = false;
        //内容是否可选
        textview.isselectable = false;
        //属性font字体,字体颜色,textalignment:对齐方式

        //给文字中电话和网址自动加上链接
        textview.datadetectortypes = []//都不加链接
        textview.datadetectortypes = .phonenumber // 只有电话好吗
        textview.datadetectortypes = .link // 网址
        textview.datadetectortypes = .all //全加上


        //给点选文字弹出的菜单中(全选,复制,后面加上自定义按钮)
        let mail = uimenuitem(title:"邮件",action:#selector(viewcontroller.onmail))
        let menu = uimenucontroller();
        menu.menuitems = [mail];
        }
          @objc func onmail(){
      print("我是加上的按钮点击事件")

    }

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网