Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Manesh

macrumors member
Original poster
Oct 30, 2013
43
8
The problem I have is the same as this guy : http://stackoverflow.com/questions/24453108/smooth-uitextview-auto-scroll-to-bottom-of-frame-solved

Whatever code I use to scroll to the bottom of a textview starts from the top and scrolls to the bottom rather than scroll from where the uitextview currently sits.

When I try the solution of this guy, which was :

Code:
textview.scrollEnabled= NO;
textview.text = [textview.text stringByAppendingString:createdString];
textview.scrollEnabled= YES;
[textview scrollRangeToVisible:textview.selectedRange];

I get a bug where it seems that the 'textview.scrollEnabled' never gets back to YES, so the scroll will simply never work.

I either have that weird scrolling where it gets back to top then to bottom or the other bug where the scrolling enabled never gets back to YES.

help?:mad:
 
Last edited by a moderator:
Hi,

Im not sure if a textView works exactly the dame as a scrollView
But I'm using

scrollView.contentOffset.y

To see how far the user already scrolled in the scrollview

Ap if you take your total height - this offset you will know how much there is left to scroll.

Maybe you need something like textview.scrollview.

Just look through your options once you typed textview.

Maybe its of any help, Im not sure.

Let me know :)

Btw. I never trust the 'textview.scrollEnabled= NO;' I rather use it for statements
As there are functions like [textview setScrollEnabled: YES];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.