标签:gre 自定义 word apple let 颜色 ade edit frame
1
2
3
4
|
let textview = UITextView (frame: CGRect (x:10, y:100, width:200, height:100)) textview.layer.borderWidth = 1 //边框粗细 textview.layer.borderColor = UIColor .gray.cgColor //边框颜色 self .view.addSubview(textview) |
1
|
textview.isEditable = false |
1
|
textview.isSelectable = false |
1
2
3
4
|
textview.dataDetectorTypes = [] //都不加链接 textview.dataDetectorTypes = UIDataDetectorTypes .phoneNumber //只有电话加链接 textview.dataDetectorTypes = UIDataDetectorTypes .link //只有网址加链接 textview.dataDetectorTypes = UIDataDetectorTypes .all //电话和网址都加 |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import UIKit class ViewController : UIViewController { override func viewDidLoad() { super .viewDidLoad() let textview = UITextView (frame: CGRect (x:10, y:100, width:200, height:100)) textview.layer.borderWidth = 1 //边框粗细 textview.layer.borderColor = UIColor .gray.cgColor //边框颜色 self .view.addSubview(textview) let mail = UIMenuItem (title: "邮件" , action: #selector( ViewController .onMail)) let weixin = UIMenuItem (title: "微信" , action: #selector( ViewController .onWeiXin)) let menu = UIMenuController () menu.menuItems = [mail,weixin] } func onMail(){ print ( "mail" ) } func onWeiXin(){ print ( "weixin" ) } override func didReceiveMemoryWarning() { super .didReceiveMemoryWarning() } } |
标签:gre 自定义 word apple let 颜色 ade edit frame
原文地址:http://www.cnblogs.com/gongyuhonglou/p/6124476.html