Search code examples
iosiphonescrolluitextviewtext-cursor

iOS -- UITextView disable scrolling but enable touches


Is there any way to do this?

What I really want is a UITextField where I can control the location of the cursor. But as far as I can tell, that is impossible. So I am looking at using a UITextView. This does allow one to control the cursor location. But scrolling is getting in the way -- my text is scrolling here and there, and I don't want that.


Solution

  • If I set scrollEnabled to NO and have an empty implementation of scrollRectToVisible:animated:, it appears to disable scrolling.