【发布时间】:2018-04-07 11:06:01
【问题描述】:
我是快速编程的新手,我需要设计带有浮动占位符输入的登录页面。我已经使用 POD 安装了 MDCTextInput。
添加导入
import MaterialComponents.MaterialTextFields
并在 viewDidLoad() 下面的代码中添加,
companyID.placeholder = "Company ID"
companyID.placeholderLabel.highlightedTextColor = UIColor.white
companyID.placeholderLabel.textColor = UIColor.white
companyID.underline?.color = UIColor.white
companyID.delegate = self
我已按照 IOS 中的 Material components 中给出的步骤进行操作
这条线我不太清楚,
To achieve the animations and presentations defined by the guidelines (floating placeholders, character counts), a controller that conforms to protocol MDCTextInputController must be initialized to manage the text field.
我没有得到浮动占位符动画,如何在 swift4 中执行此操作?请任何人给我一个想法。
Material iOS Github 链接是: material-components-ios
【问题讨论】:
-
能否添加MDCTextInputController的git路径
-
@Anbu.karthik 我指的是这个链接material.io/components/ios/catalog/textfields
-
下载 GitHub 项目 zip 并运行演示项目。
标签: ios swift3 material-design