UITextView starting from the bottom

I'm having problems with UITextView . I saw that other people had this problem before, but whenever my application loads on my phone, all UITextViews start from the bottom of their text, and I have to scroll up.

I tried many solutions, but I need a solution for use only on the storyboard, since I have some views without assigned classes.

enter image description here enter image description here

EDIT

I think this happens when scrolling is on - so how can I turn on scrolling but not stop it?

+4
source share
3 answers

iOS 9.2,

contentOffset

enter image description here

+2

, , Storyboard.
, , TextView

TextView UIViewController

- (void)viewWillAppear:(BOOL)animated {
    [self.myTextView setContentOffset:CGPointZero];
}

TextView UIView

- (void)layoutSubviews{
    [self.myTextView setContentOffset:CGPointZero];
}

+2

Have you tried something like:

[self.textView scrollRangeToVisible:NSMakeRange(0, 0)];

0
source

Source: https://habr.com/ru/post/1621610/


All Articles