Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I just installed XCode 4.2, and iOS5 on my test iPad today, and I got the same problem. </p> <p>I could solve the problem by observing the sample code from Apple named ScrollViewSuite. It contains an app named TapToZoom that shows the proper implementation of the pinch zooming (that works in iOS5). Basically, I just had then to do three things: 1- define a constant at the beginning of the .m file of the view controller (just after the #import):</p> <pre><code>#define ZOOM_VIEW_TAG 100 </code></pre> <p>2-Then, I added a line at the beginning of viewDidLoad (or loadView if you don't use a nib file and create your view through coding - as for the Apple example) that sets a tag on your tableView (the table embedded in the scrollView):</p> <pre><code>[tableView setTag:ZOOM_VIEW_TAG]; </code></pre> <p>3- Then, finally, change the value returned in the viewForZoomingInScrollView, from the previous 'return tableView' to: </p> <pre><code>return [scrollView viewWithTag:ZOOM_VIEW_TAG]; </code></pre> <p>Once these three elements were in place, my zooming not only was working again, but I realize it is now much smoother than before - which means that my previous implementation was already deficient in iOS4. </p> <p>I believe that if you follow these directions, you problem should be solved. Please tell me if not. (technically, you could set the tag of your tableView in the interface window, then get rid of steps one and two, and just give the tag number you defined in the step 3, but on the long run the code would be less readable - at least in my opinion)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload