RaviM RaviM - 5 months ago 14
Objective-C Question

Automatic scrolling in textview in ios 4.3 + iphone sdk

automatic scroll occurs in ios 4.3 , when textViewShouldBeginEditing method call.
I want to stop this automatic scrolling.
currently scroll goes upside.
Help me on this textview question.

Thanks in advance.

Answer
[txtview scrollRectToVisible:CGRectMake(0, txtview.contentSize.height-txtview.frame.size.height, txtview.frame.size.width, txtview.frame.size.height) animated:NO];

set this frame in textview begin editing. And set y position of textview txtview.contentSize.height-txtview.frame.size.height
in textview should change in characters.

It works..

Comments