如何使用 CosmicMinds Material 库减少 material 文本字段中动画占位符文本的 space?
how to reduce the space of animated placeholder text in material Textfield using CosmicMinds Material library?
我正在为我的一个项目使用 CosmicMinds Material 库。我面临悬停文本的一个问题。我想减少我无法弄清楚的 space。Attached Image
我的示例代码:
func prepareChangePasswordField() {
enterPasswordText.placeholder = "Password"
enterPasswordText.detailColor = Color.red
enterPasswordText.delegate = self
enterPasswordText.placeholderNormalColor = UIColor.lightGray
enterPasswordText.placeholderActiveColor = Color.blue.base
enterPasswordText.dividerNormalColor = Color.grey.base
enterPasswordText.dividerActiveColor = Color.blue.base
enterPasswordText.isVisibilityIconButtonEnabled = true
enterPasswordText.visibilityIconButton?.tintColor = Color.grey.base.withAlphaComponent(passwordText.isSecureTextEntry ? 0.2 : 1.0)
}
func prepareConfirmPasswordField() {
confirmPasswordText.placeholder = "Confirm password"
confirmPasswordText.detailColor = Color.red
confirmPasswordText.delegate = self
confirmPasswordText.placeholderNormalColor = UIColor.lightGray
confirmPasswordText.placeholderActiveColor = Color.blue.base
confirmPasswordText.dividerNormalColor = Color.grey.base
confirmPasswordText.dividerActiveColor = Color.blue.base
confirmPasswordText.isVisibilityIconButtonEnabled = true
confirmPasswordText.visibilityIconButton?.tintColor = Color.grey.base.withAlphaComponent(passwordText.isSecureTextEntry ? 0.2 : 1.0)
//self.view.addSubview(userNameText)
//view.layout(emailTextField).center(offsetY: -passwordField.height - 60).left(20).right(20)
}
您尝试过 placeholderVerticalOffset
属性 吗?
我正在为我的一个项目使用 CosmicMinds Material 库。我面临悬停文本的一个问题。我想减少我无法弄清楚的 space。Attached Image
我的示例代码:
func prepareChangePasswordField() {
enterPasswordText.placeholder = "Password"
enterPasswordText.detailColor = Color.red
enterPasswordText.delegate = self
enterPasswordText.placeholderNormalColor = UIColor.lightGray
enterPasswordText.placeholderActiveColor = Color.blue.base
enterPasswordText.dividerNormalColor = Color.grey.base
enterPasswordText.dividerActiveColor = Color.blue.base
enterPasswordText.isVisibilityIconButtonEnabled = true
enterPasswordText.visibilityIconButton?.tintColor = Color.grey.base.withAlphaComponent(passwordText.isSecureTextEntry ? 0.2 : 1.0)
}
func prepareConfirmPasswordField() {
confirmPasswordText.placeholder = "Confirm password"
confirmPasswordText.detailColor = Color.red
confirmPasswordText.delegate = self
confirmPasswordText.placeholderNormalColor = UIColor.lightGray
confirmPasswordText.placeholderActiveColor = Color.blue.base
confirmPasswordText.dividerNormalColor = Color.grey.base
confirmPasswordText.dividerActiveColor = Color.blue.base
confirmPasswordText.isVisibilityIconButtonEnabled = true
confirmPasswordText.visibilityIconButton?.tintColor = Color.grey.base.withAlphaComponent(passwordText.isSecureTextEntry ? 0.2 : 1.0)
//self.view.addSubview(userNameText)
//view.layout(emailTextField).center(offsetY: -passwordField.height - 60).left(20).right(20)
}
您尝试过 placeholderVerticalOffset
属性 吗?