1

I am using Material Textfield for my project,

@IBOutlet weak var cellTextField: MDCTextField!
func setUpCellUI() {
    cellTextField.clearButton.isHidden = true
    cellTextField.font = CSFont.fontWithName(.Medium, size: 17)
    cellTextField.textColor = UIColor.contSyncTextLightColor()
    textFieldControllerFloating = MDCTextInputControllerLegacyDefault(textInput: cellTextField)
}

and error I am setting as

self.textFieldControllerFloating.setErrorText(error.errorString, errorAccessibilityValue: nil)

if error message is long text is going out of the screen, How can I fix this ? See the following image.

enter image description here

Community
  • 1
  • 1
Jeni Khant
  • 350
  • 3
  • 13

2 Answers2

1

you can solve this by setting the number of line for leadingUnderlineLabel

MDCTextField *textField = [[MDCTextField alloc] init];
textField.leadingUnderlineLabel.numberOfLines = 0;
textField.leadingUnderlineLabel.lineBreakMode = NSLineBreakByWordWrapping;

https://github.com/material-components/material-components-ios/releases/tag/v93.2.0

Shuja Ud Din
  • 434
  • 5
  • 17
0

This is a known, still open, issue.

shadowsheep
  • 14,048
  • 3
  • 67
  • 77