1
2
3
4
|
禁用了就不会自动变为连接了
原文:
http://www.cnblogs.com/Free-Thinker/p/4838141.html
1、多行文本控件的创建
2,是否可编辑
1
3,内容是否可选
textview.selectable=
4,属性font设置字体,textColor设置字体颜色,textAlignment设置对齐方式
6,自定义选择内容后的菜单
4
1
2
3
4
|
var
textview=
UITextView
(frame:
CGRectMake
(10,100,200,100))
textview.layer.borderWidth=1
//边框粗细
textview.layer.borderColor=
UIColor
.grayColor().
CGColor
//边框颜色
self
.view.addSubview(textview)
|
textview.editable=
false
|
6,自定义选择内容后的菜单
import
UIKit
class
ViewController
:
UIViewController
{
override
func
viewDidLoad() {
super
.viewDidLoad()
weixin =
"微信"
"onWeiXin"
)
menu =
UIMenuController
()
menu.menuItems =
NSArray
(array: [mail,weixin])
}
onMail(){
println
(
"mail"
)
}
onWeiXin(){
"weixin"
)
}
didReceiveMemoryWarning() {
.didReceiveMemoryWarning()
}
}
|