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 10-15-2010, 01:10 PM   #1 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 8
Chibisnow is on a distinguished road
Question Continuously dragging uiimageview over two scrollviews

So my set up is as follows:
I subclassed uiimageview where I override the touchesMoved method so that the image can be dragged and then a viewcontroller is passed to the image so that when the image goes out of bounds of the scrollview, it gets added to the other scrollview within the viewcontroller. My problem, this cannot be done continuously, so the user would have to reselect the image on the other view. Is there a way I could make the image continually drag over the two scrollviews with this current set up? And thanks in advance!

Oh, and here's some code for the touchesMoved code so far:

-(void)touchesMovedNSSet *)touches withEventUIEvent *)event
{
CGPoint touch1, touch2;
if([touches count] == 1)
{
CGPoint newTouch =
[[touches anyObject] locationInView:[self superview]];
CGPoint lastTouch = [[touches anyObject] previousLocationInView:[self superview]];


float xDifference = newTouch.x - lastTouch.x;
float yDifference = newTouch.y - lastTouch.y;

//imagecontainer is a uiview that holds uiimageviews and is contained in a uiscrollview
int bound = mycontroller.imagecontainer.bounds.size.width;

CGAffineTransform translate = CGAffineTransformMakeTranslation(xDifference,yDiff erence);
[self setTransform: CGAffineTransformConcat([self transform], translate)];
if(lastTouch.x < bound+100
&& lastTouch.x > bound-100 && scrollView == 1)
{
[self removeFromSuperview];
[mycontroller.mapcontainer addSubview:self];
self.center = C CGPointMake(mycontroller.mapcontainer.bounds.origi n.x,
lastTouch.y);
printf("X: %f, Y: %f", self.center.x, self.center.y);
self.moveOver = FALSE;
self.scrollView = 2;
}
}
Chibisnow is offline   Reply With Quote
Old 10-15-2010, 02:37 PM   #2 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 8
Chibisnow is on a distinguished road
Default

Does anyone have ideas? I really just need to drag the images over two uiscrollviews without having that jump and having to reselect the uiimageview again. I'm sure there are many apps that do it, somehow.
Chibisnow is offline   Reply With Quote
Reply

Bookmarks

Tags
dragging uiimageview, uiimageview and uiimage, uiscrollview, uiview

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: 345
8 members and 337 guests
Desert Diva, dre, hain, HemiMG, lendo, mottdog, oceanlablight
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,895
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 01:06 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0