TextView implementation using material design iOS swift || MDCOutlinedTextArea implementation

  Solution:

Import the below libraries in your class

import MaterialComponents.MaterialTextControls_FilledTextAreas

import MaterialComponents.MaterialTextControls_OutlinedTextAreas

import MaterialComponents.MaterialTextControls_OutlinedTextAreasTheming


Inside the class you can create the textView as like below


        let textViewCustom =  MDCOutlinedTextArea()


You can set the placeholder as like below


textViewCustom.label.text = "placeholder"


You can set the outline border color as like below


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

You can set the placeholder color as like below


 textViewCustom.setNormalLabel(.lightGray, for: .normal)


You can minimise the height of the field using below option


        textViewCustom.verticalDensity = 40

        textViewCustom.maximumNumberOfVisibleRows = 2


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


        textViewCustom.preferredContainerHeight = 100

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift