iPhone ScrollView zoom problems

I'm new to iPhone dev and Obj-C and I have several problems with ScrollView/ImageView while getting close to deadline. I used IB to create interface so I access most parameters via builder.

1) I was using touch events (begin/moved/ended) on imageView to switch images. When I put ImageView to ScrollView the old gestures stopped working and I can only zoom. If scrollView of both have focus I can't use my gestures even when zoomed out. How can I use both?

2) How do I zoom only image part of view? Unfortunately I also see background area around :/ What's worse - after rotating the view keeps it's old dimensions and I have even more black areas around image. For some reason image is in top-left corner.

Code snippets I found doesn't really help me much in this case. I have various images of different sizes in imageView to switch and zoom in/out.

EDIT: Ok, a little different. How do I override scrollview touch mode so that when image is zoomed out (to screen size) "normal" gestures would work. Currenly I have either scroll view scrolling or gestures, can't use both. Anyone?


Solved by dynamically changing imageview to imagesize and switching like:

- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale {
    if (scrollView.zoomScale==1.0) {
    scrollView.userInteractionEnabled = NO;
    imageView.userInteractionEnabled = YES;

Not the best solution but works good enough.

Need Your Help

R.id not resolving

android videoview

I added a video view to one of app pages and when i try and identify it by doing R.id.videoview) the .id does not resolve. Can someone please help me?

find the bounds of my map given its center point with google maps api v3

javascript google-maps google-maps-api-3 google-maps-markers bounds

I am trying to determine if a marker which is being animated is within the viewable area of my map. If it is not, I want to tell my map to pan to the marker position as a center position. How do I do

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.