• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Keeping UIScrollView content centered
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Keeping UIScrollView content centered


  • Subject: Keeping UIScrollView content centered
  • From: Rick Mann <email@hidden>
  • Date: Fri, 14 Jun 2013 15:11:59 -0700

As I'm experimenting with how to implement pinch and rotate gestures in a UIScrolLView, I set up a non-autolayout (traditional) pinch-zooming UIScrollView with a UIImageView inside it.

I followed the instructions here:

http://developer.apple.com/library/ios/#documentation/windowsviews/conceptual/UIScrollView_pg/ZoomZoom/ZoomZoom.html

And looked at the TapToZoom example. This mostly works, but if I zoom way out, so that my image (which has an aspect ratio that doesn't match the screen) is completely visible, it's not centered in the view; it's pinned to the upper-left.

The Photos app seems to nicely keep the image centered. What's the right way to do this?


--
Rick




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Multiple Observations
  • Next by Date: Re: assertion failure from NSScrollView
  • Previous by thread: Re: Multiple Observations
  • Next by thread: Combining pan, zoom, and rotate gestures into one?
  • Index(es):
    • Date
    • Thread