TextField implementation using material design iOS swift || MDCOutlinedTextField implementation

 Solution:

Import the below libraries in your class

import MaterialComponents.MaterialTextControls_FilledTextAreas

import MaterialComponents.MaterialTextControls_FilledTextFields

import MaterialComponents.MaterialTextControls_OutlinedTextFieldsTheming


Inside the class you can create the textfield as like below


        let textField =  MDCOutlinedTextField()


You can set the placeholder as like below


textField.label.text = "placeholder"


You can set the outline border color as like below


 textField.setOutlineColor(UIColor.red, for: .normal)

You can set the placeholder color as like below


 textField.setNormalLabelColor(.lightGray, for: .normal)


You can minimise the height of the field using below option


        textField.verticalDensity = 40


You can increase the height value not the fontsize and other as using below


        textField.preferredContainerHeight = 100

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift