• 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
Re: Programmatically pinch a UIView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programmatically pinch a UIView


  • Subject: Re: Programmatically pinch a UIView
  • From: Carl Hoefs <email@hidden>
  • Date: Wed, 11 May 2016 14:14:06 -0700

> On May 11, 2016, at 2:08 PM, Quincey Morris <email@hidden> wrote:
>
> On May 11, 2016, at 13:56 , Carl Hoefs <email@hidden <mailto:email@hidden>> wrote:
>>
>> I just tried UIScrollView & -setZoomScale:. No effect.
>
> I think you’re flailing now. ;)
>
>> I was hoping there was a way to initially programmatically pinch the view down by 10%, so the view's frame isn't reduced as well
>
> You can’t make a view smaller without making it … smaller. Perhaps you’re not distinguishing the frame from the bounds? If you apply a 10% reduction to a 100 x 100 view via a transform, its frame will be 90 x 90, but its bounds will still be 100 x 100.
>
>> Would it help if I changed my UIView to be a UIScrollView instead?
>
> Well, you wouldn’t change your custom UIView to *be* a UIScrollView, but you might place your custom UIView *inside* a UIScrollView. Setting the zoomScale on a scroll view changes the transform on the content subviews, not on the scroll view itself. But wouldn’t you have a zoomable custom view inside a scroll view anyway? How else do you plan for the user to pan around when it’s zoomed in?
>
>> I was hoping there was a way to initially programmatically pinch the view down by 10%
>
> You could, I suppose, scale your content drawing, rather than scaling the view. In that case, you’d need to put the pinch gesture recognizer on your view, save the calculated scale factor every time the recognizer changes state, and redraw your view in drawRect: using the saved scale. But that’s the functionality that UIScrollView is generally designed to provide for you.
>
Okay, I'm a little confused... the UIView that's currently there handles pinch zoom in/out fine. Is there a way to programmatically cause a 'pinch zoom out by 10%'? Do you mean that the only way to accomplish this is to have fingers touch the screen?
-Carl

_______________________________________________

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


  • Follow-Ups:
    • Re: Programmatically pinch a UIView
      • From: Quincey Morris <email@hidden>
References: 
 >Programmatically pinch a UIView (From: Carl Hoefs <email@hidden>)
 >Re: Programmatically pinch a UIView (From: David Duncan <email@hidden>)
 >Re: Programmatically pinch a UIView (From: Carl Hoefs <email@hidden>)
 >Re: Programmatically pinch a UIView (From: Carl Hoefs <email@hidden>)
 >Re: Programmatically pinch a UIView (From: Carl Hoefs <email@hidden>)
 >Re: Programmatically pinch a UIView (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Programmatically pinch a UIView
  • Next by Date: Re: presentationControllerForPresentedViewController(…) is called multiple times
  • Previous by thread: Re: Programmatically pinch a UIView
  • Next by thread: Re: Programmatically pinch a UIView
  • Index(es):
    • Date
    • Thread