material-components-ios icon indicating copy to clipboard operation
material-components-ios copied to clipboard

isFloatingEnabled in MDCTextInputControllerOutlined

Open Kalidasan1 opened this issue 4 years ago • 1 comments

As per my requirement, I want to hide the floating label in MDCTextInputControllerOutlined. If I check the file, isFloatingEnabled flag is always YES. I want to set this as NO. Please help to set this as a customisation value like floatingEnabled so that we can just pass YES/NO based on our condition

  • (BOOL)isFloatingEnabled { return YES; ------ Here instead of setting YES, please have the floatingEnabled varaible }

  • (void)setFloatingEnabled:(__unused BOOL)floatingEnabled { // Unused. Floating is always enabled. }

Kalidasan1 avatar Feb 26 '21 16:02 Kalidasan1

Hi @Kalidasan1, I encourage you to switch to our newer text field offerings, specifically the MDCOutlinedTextField. To use it add TextControls+OutlinedTextFields and/or TextControls+OutlinedTextFieldsTheming to your Podfile, and then #import "MaterialTextControls+OutlinedTextFields.h". See these docs for more info. To disable floating on the new text field use textFied.labelBehavior = .disappears. Hope this helps!

andrewoverton avatar Feb 26 '21 18:02 andrewoverton