Subscribe ( )

iPhone Programming Tutorials


 

Forum

You must be logged in to post Login Register

Search 

Manually zoom out on UIScrollView

User Post

7:04 am
October 15, 2008


joemc91

Noob

posts 2

1

I'm looking to manually cause a UIScrollView to zoom out when double tapped.  I've got the program correctly recognizing the double tap, but the zoom doesn't function properly.  Basically, it zooms out, but one can zoom out even beyond it's bounds once that happens.  So far, the code I have is as follows:

UIView *view = [[self delegate] viewForZoomingInScrollView:self];

if (view == nil) {

return;

}

CGSize newContentSize = CGSizeMake(self.frame.size.width, view.frame.size.height / view.frame.size.width * self.frame.size.width);

NSLog(@”%f %f”,newContentSize.width,newContentSize.height);

[UIView beginAnimations:nil context:NULL];

[UIView setAnimationDuration:0.4];

self.contentOffset = CGPointZero;

view.frame = CGRectMake(self.frame.origin.x,

self.frame.origin.y,

newContentSize.width,

newContentSize.height);

[UIView commitAnimations];


Any ideas on how to get the view to actually zoom out short of feeding it fake touchesMoved calls?

Search 

About the iCodeBlog forum

Most Users Ever Online:

44


Currently Online:

2 Guests

Forum Stats:

Groups: 2

Forums: 6

Topics: 419

Posts: 893

Membership:

There are 934 Members

There has been 1 Guest

There are 2 Admins

There is 1 Moderator

Top Posters:

bobcubsfan – 54

crazyiez – 30

Uhu – 17

AdeC – 17

Nick – 15

jitesh61 – 12

Administrators: Brandon (88 Posts), Collin (0 Posts)

Moderators: VertigoSol (26 Posts)



©   

  • Posted by on 6 Aug 2008 in Uncategorized
  •   |  
  •   |  
  •   |  
  • Comments Off

Comments are closed.