1

I want to use mdc components in my SwiftUI app. I created a class with protocol UIViewRepresentable, but I would like to modify the height to some constant or maybe remove inner padding.

func makeUIView(context: Context) -> MDCOutlinedTextField {
    let textField = MDCOutlinedTextField()
    
    textField.setOutlineColor(MyColor.greyLightUI, for: .normal)
    textField.setOutlineColor(MyColor.greyLightUI, for: .editing)
    textField.setFloatingLabelColor(MyColor.greyUI, for: .normal)
    textField.setFloatingLabelColor(MyColor.greyUI, for: .editing)
    textField.setNormalLabelColor(MyColor.greyUI, for: .normal)
    textField.setNormalLabelColor(MyColor.greyUI, for: .editing)
    textField.font = UIFont(name: "Montserrat-Normal", size: 14)
    textField.setTextColor(MyColor.darkUI, for: .normal)
    textField.setTextColor(MyColor.darkUI, for: .editing)
    
    textField.keyboardType = self.keyboardType
    
    return textField
}
0

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.