Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-06-2010, 11:19 AM   #1 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default UIScrollview with multiple images and zoom\pan + setContentOffset = strange behavior

Hi to all, i started a project where i need to show more images and allow a zoom on it.

In order to add more images to my view i used 2 scrollView: myScrollViewInt and myScrollViewExt. (myScrollViewInt subview of myScrollViewExt).
I added images to internal scrollview. All work as expected, the problem is when i tried to change page with a button.

Example of the code to go in page 2 (portrait):
Code:
-(IBAction) goToPageTwoPortrait{
   CGRect rectWillSee = CGRectMake(768, 0, 768, 1024);
	
   [myScrollViewInt scrollRectToVisible:rectWillSee animated:YES];
	
   //[myScrollViewInt setContentOffset:CGPointMake(768, 0) animated:YES]; //SAME ISSUE using it
}
some variables are hard coded, however my images are 768*1024.

Now what happen?

1) start project
2) zoom in with pinch
3) click button to go page 2
4) vertical pan not work anymore! just horizontal pan of the images!.

1) start project
2) click button to go page 2
3) zoom in with pinch
4) vertical pan work as expected.

it is a really strange problem that not allow me to use a function "go to page" normally. I'm fighting with it at least since 1 full day .

Can anyone help me? i seen and tried with all apple example of scrollview, but none of it use multiple images + zoom.

Thanks!.
__________________

Last edited by dany_dev; 07-07-2010 at 06:52 AM.
dany_dev is offline   Reply With Quote
Old 07-07-2010, 06:20 AM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

solved, after about 16 hours of (useless) debug.

Code:
[myScrollViewExt removeFromSuperview];
[myScrollViewInt removeFromSuperview];

[myScrollViewInt scrollRectToVisible:frame animated:YES];
	
[self.view addSubview:myScrollViewExt];
[myScrollViewExt addSubview:myScrollViewInt];
So, it is only 1 of the thousands tries that i done.

I hope that it can help someone in future.
__________________
dany_dev is offline   Reply With Quote
Reply

Bookmarks

Tags
multiple images, pan, scrollview, uiscrollview, zoom

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 328
8 members and 320 guests
anothermine, Chickenrig, firecall, givensur, iNet, michaelhansen, PixelInteractive, stanny
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,892
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:29 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0