I have a view containing a button and a text view. When the button is pressed, the hidden status of the text will be changed and displayed on the screen. Springs and spacers are configured so that the text expands vertically with a view. All this is done in IB
Then I insert the text into the text image programmatically, but I need the text image to display all its contents without the need for scrolling.
This is the code that I use to calculate the height of the text in text form:
- (float) getTextViewHeight { //based on http://developer.apple.com/library/mac/
With a call to -sizeToFit in text form or without it, it will be either too large or too small (depending on its contents).
I need to get the height of the text view with all the content so that I can adjust the size of the view.
I know that I could use NSTextField as a label, but I need an NSTextView for its added functionality (in particular, using the control built into scrollview).
Does anyone have any suggestions?
source share