narco
narco

Reputation: 840

NSTextView stops being able to scroll once new text is set

I have a TextView made in the Interface Builder;

It scrolls fine with its default text, but as soon as I programatically set the text to something else, it no longer scrolls.

I do not disable scrolling, and I have tried enabling scrolling (setScrollEnabled:YES), and user interaction (setUserInteractionEnabled:YES) both of which make no difference.

The things that I have found:

self.myTextView.text = @"any text"; (or [self.myTextView setText:@"any text"]; has the same effect.)

If I delete these two other TextFields, then the one in question works as expected, i.e. it scrolls after adding text.

Any thoughts? Thanks.

Upvotes: 0

Views: 248

Answers (1)

m-farhan
m-farhan

Reputation: 1426

Make sure your new text is long enough to be able to get scroll. if text is just one line it wont scroll but if its larger then text area size then it will scroll its by default settings

Upvotes: 2

Related Questions