0

In my project I am using NSTextField. As my application supports multiple languages, The same text field may have different text lengths according to various languages. Is there any option to solve this using auto lay out, setting constraints, or is there any property for the text field to adjust automatically according to the text. Any help is appreciated.

PinkeshGjr
  • 8,460
  • 5
  • 41
  • 56
Govind
  • 2,337
  • 33
  • 43

1 Answers1

-1

To get the "fitted" size used by the text view after it's updated its text, call usedRectForTextContainer: on the textView's layoutManager property, passing the textView's textContainer property as an argument.

Autoresize textView:

[myTextView sizeToFit];
PinkeshGjr
  • 8,460
  • 5
  • 41
  • 56