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?


About the iCodeBlog forum

Currently Online:

4 Guests

Maximum Online: 19

Forums:

Groups: 2

Forums: 6

Topics: 140

Posts: 460

Members:

There are 252 members

There are 1 guests


Brandon has made 79 posts

Top Posters:

bobcubsfan - 44

crazyiez - 30

VertigoSol - 17

Uhu - 17

Nick - 15

Administrator: Brandon | Moderators: VertigoSol


© - Version 3.1.4 (Build 357)  

Share and Enjoy: