UITextView always appears scrolled to bottom of content?

uitextview scroll to bottom
uitextview scroll to top
uitextview scroll to bottom swift 4
uitextview scroll to top swift 4
uitextview scroll offset

I am using storyboard with auto layout, scene contains UITextView with some text in it, you can see in following image:

But whenever i move to this scene in running application, it would be like following:

I have researched it a lot and tried following code, even then it not worked for me:

[self.scrollView setContentOffset:CGPointZero animated:NO];

Any help would be appreciated.

Try following, may it help:

[yourTextView scrollRectToVisible:CGRectMake(0,0,1,1) animated:YES];

OR

set the content offset in viewDidLayoutSubviews for it to take effect.

- (void)viewDidLayoutSubviews {
[yourTextView setContentOffset:CGPointZero animated:NO];
}

OR

in viewDidLoad

[yourTextView scrollRangeToVisible:NSMakeRange(0, 1)];

UITextView always appears scrolled to bottom of content?, After setting the text, (e.g. textView.text = NSString(format: "There is a lot of text to follow: %@", textString) the UITextView is displayed with the  UITextView always appears scrolled to bottom of content? If you want to avoid your textview scrolling its content up it's better to use the scrollRectToVisible

Swift 4
contentTextView.scrollRangeToVisible(NSRange(location: 0, length: 0))

How do I set UITextView scroll to top? |Apple Developer Forums, The text for some pages fits and does not require scrolling. A few pages are to scroll for more? I can stick a static label at the bottom of the UITextView that there might be more, but that seems inelegant if it's not always true. If you edit the first line of the textView, hasSuffix:@" " will return YES and the textView will immediately scroll to the bottom of the document. Or, start with a blank textView and type one word, then press return. The text will scroll to the bottom.

Here's what worked: just setting the UITextView's text property, then calling scrollRangeToVisible with an NSRange with location:0, length:0. My text view was not editable, and I tested both selectable and non-selectable (neither setting affected the result).

Code:

[textview scrollRectToVisible:NSRange(0, 0) animated:YES];

How to detect if text doesn't fit a textview? |Apple Developer Forums, But when clicking the button, I wan't to scroll down to the bottom of the text field to insert cells above the currently displaying ones so that they appear above the layoutIfNeeded() // if you use Auto layout Edit We are creating a UITextField  Some system views, like table views, help you by scrolling the first responder into view automatically. If the first responder is at the bottom of the scrolling region, however, you may still need to resize or reposition the scroll view itself to ensure the first responder is visible.

Scroll UITextView To Bottom, So if you click the link you posted the accepted answer shows this objective-C I use the following in an app that scrolls to the bottom automatically when text is  On long pages with lots of content the footer is pushed off the visible page to the very bottom. Just like a normal website, it will come into view when you scroll all the way down. This means that the footer isn’t always taking up precious reading space. 100% valid CSS with no hacks. The CSS used in this demo is 100% valid and contains no hacks.

Scroll to the bottom of textView programmatically, Hi, i am trying to append some text to my textview field. The text is really long but then i try to scroll to bottom in the textview. This i not working. Scroll to very bottom of the text view Scroll as far up as possible to see the bottommost arrow over the keyboard. Tap to the right of the arrow and type a few characters. Again there is some weird flickering scroll movement,

Scrolling to the end of a textview, Does anyone know how to make UITextView stay scrolled at the last line? and i want the view to just scroll one line and display the new line at the bottom. the previous scroll position and reseting it after updating the "text". Does anyone know how to make UITextView stay scrolled at the last line? Kinda like new lines being added and i want the view to just scroll one line and display the new line at the bottom. Something like XCode's debug console UITextView seem to insist on doing the reverse of what i wanted

Comments
  • Possible duplicate of UITextView Starts at Bottom or middle of text
  • i am not sure, but it may have something to do with autolayot.
  • If you want to avoid your textview scrolling its content up it's better to use the scrollRectToVisible method. self.textView.scrollRectToVisible(CGRect.init(x: 0, y: 0, width: 1, height: 1), animated: false)