I have a read only UITextView (i.e. the editable property is set to NO) and I am having some difficulties with it on the iPhone 3.1.3 OS. Note that what I am describing below does not happen using the 4.0 OS.
Even though the control is set to read only, it is possible to set the caret position by tapping. It is even possible to get the caret position to display (although no keyboard pops up). Now the problem is that once this happens, then every time I set the new text into the control, the caret ends up at the bottom of the control and the control scrolls to the bottom, rather than remaining at the top.
Here are some things that I have tried to fix this problem:
I have tried manually setting the top position after I set the text. This does not work.
I have tried setting the caret position to the top of the control. Unfortunately, with the 3.1.3 OS this brings up the keyboard, despite the fact that the control is read only.
I have set up a delegate so and return NO from the textViewShouldBeginEditing call to prevent they keyboard from popping up when I set the caret position. Unfortunately is never called in that case (it is only called when the user initiates an action that will begin editing).
I have tried sub-classing the control and overriding the canPerformAction function to try an prevent the user from selecting text or setting the caret position. But even if I return NO from this for all cases, the user is still able to select text, and eventually get the cursor to the bottom of the file.
I have made several posts to the Apple forum, but no one has been able to suggest a working solution. Does anyone here know what else I might try?