Take the 2-minute tour ×

Has anyone gotten multi-touch zoom to work on a textView?

I have searched SO and found no simple way to zoom in on a UITextView or UIScrollView. I was led to this link which says I need to write custom views to overwrite the existing ones in order to be able to zoom in to a textView. I can not believe this and would like someone to please let me know if there is a simple way to zoom in and zoom out using multi-touch on a UITextView or a UIScrollView.

I tried setting the options in the IB to enable multi-touch as well as the max zoom. But this does not work.

Please advise. Thank you.

share|improve this question
Still no joy getting multi-touch zoom to work on a textView. Anyone out there can recommend a sample that shows this working? –  jroyce Feb 20 '12 at 0:37
Does zoom work with textView? Is this such an obscure question that no one has a response? Please help... –  jroyce Mar 1 '12 at 18:01
add comment

3 Answers

up vote 1 down vote accepted

1 Create a new project with single view (using storyboard & arc)

2 Open Storyboard and add a UIScrollView to your main view controller

3 Set the UIScrollView's delegate to the view controller and create an IBOutlet for the UIScrollView called scrollview

4 Add a UITextView to the scrollview and set an IBOutlet called textview

5 At the end of the ViewDidLoad add the following code:

self.scrollview.minimumZoomScale = 0.5;
self.scrollview.maximumZoomScale = 5.0;
self.textview.text = @"Hellow World!";

6 Add the following method

    return self.textview;

7 Run the project and zoom away!

If you want the text to look not render blurry when use the answer at this Blurry UITextField Question

share|improve this answer
add comment

The UIScrollView class provides support for displaying content that is larger than the size of the application’s window. It enables users to scroll within that content by making swiping gestures, and to zoom in and back from portions of the content by making pinching gestures. By adding your UITextView to a UIScrollView, you can implement muti-touch zoom.

share|improve this answer
My UITextView is inside of the UIScrollView currently and I couldn't get it to work. I tried making my UITextView much larger than my UIScrollView in the IB but that didn't do it either. Any suggestions? –  jroyce Feb 1 '12 at 3:15
It's possible that your UITextView is becoming the first responder when you tap in the UIScrollView. You will need to differentiate a single tap (edit the text view) with a multitouch (zoom in or out). –  ibeitia Feb 1 '12 at 3:18
Hmmm ok, how do I go about setting it up correctly? –  jroyce Feb 1 '12 at 3:27
So is it true that the multi-touch zoom feature should work with text in a UITextView? –  jroyce Feb 1 '12 at 3:28
Multitouch should work with anything inside a UIScrollView. –  ibeitia Feb 1 '12 at 5:25
show 3 more comments

I am resolving to answer this question myself with the assumption that this is not possible at this time. With a textArea I have found no way to zoom in on the text. I have not found any tutorial or example that shows this is possible.

share|improve this answer
add comment

Your Answer


