swift3ios10cosmicmind

how to reduce the space of animated placeholder text in material Textfield using CosmicMinds Material library?


I am using CosmicMinds Material library for one of my projects. I am facing one issue with hover text. I would like to reduce the space between which i am unable to figure out.Attached Image

My SampleCode:

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)
}

Solution

  • Have you tried the placeholderVerticalOffset property ?