您好,我是 堆栈溢出 的新手。你能告诉我如何使用LTBouncyTextField
用于为文本字段的正确占位符设置动画的库。
我的代码是
class SignUpViewController: UIViewController {
@IBOutlet weak var registrationView: UIView!
@IBOutlet weak var Username: LTBouncyTextField!
@IBOutlet weak var Email: LTBouncyTextField!
@IBOutlet weak var Password: LTBouncyTextField!
@IBOutlet weak var ConformPass: LTBouncyTextField!
override func viewDidLoad() {
super.viewDidLoad()
registrationView.layer.borderWidth = 1
registrationView.layer.borderColor = UIColor.blackColor().CGColor
Username.abbreviatedPlaceholder = " username"
Username.alwaysBouncePlaceholder = true
Email.abbreviatedPlaceholder = "email"
Email.alwaysBouncePlaceholder = true
Password.abbreviatedPlaceholder = "password"
Password.alwaysBouncePlaceholder = true
ConformPass.abbreviatedPlaceholder = "confirmpass"
ConformPass.alwaysBouncePlaceholder = true
}
这很简单。只需将 UITextField+LTBouncyPlaceholder.swift
拖放到您的项目中。选择它作为textField
的类。添加属性,它应该可以工作。
关于ios - 我们如何在 iOS 中使用 LTBouncytextfield 库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38324130/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |