Swift - 文本输入框(UITextField)的用法
原文地址:http://hangge.com/blog/cache/detail_530.html 作者:yuhang
1,文本框的创建,有如下几个样式:
UITextBorderStyle.None:无边框
UITextBorderStyle.Line:直线边框
UITextBorderStyle.RoundedRect:圆角矩形边框
UITextBorderStyle.Bezel:边线+阴影
1
2
3
4
|
var
textField =
UITextField
(frame:
CGRectMake
(10,160,200,30))
//设置边框样式为圆角矩形
textField.borderStyle =
UITextBorderStyle
.
RoundedRect
self
.view.addSubview(textField)
|
textField.placeholder=
"请输入用户名"
|