Hey Gang.
For some reason I can move a view off the scrollView but not on..
I have tagged the view With numbers e.g. 105 104 103 102 101,100. because they correspond to the object in a mutable array and I have had problems with view tagged zero. So I delete UIView 100 and want to slide the
view 101 to where the >>>100 was. then I rebuild the scroll view.
the adding code works but the ENDREMOVEMODE does not..
if I want the movement to take a 6 seconds so that's why I'm not just scrolling there.
thanks all
Ian
For some reason I can move a view off the scrollView but not on..
I have tagged the view With numbers e.g. 105 104 103 102 101,100. because they correspond to the object in a mutable array and I have had problems with view tagged zero. So I delete UIView 100 and want to slide the
view 101 to where the >>>100 was. then I rebuild the scroll view.
the adding code works but the ENDREMOVEMODE does not..
Code:
-(void)viewToMoveTag:(UIView *)viewMoving insert:(NSInteger)inserting durationTiming:(CGFloat)duration
{
CGRect frame;
frame.origin.x = self.scrollView.frame.size.width * self.pageControl.currentPage;
frame.origin.y = 0;
frame.size = self.scrollView.frame.size;
// Setup the animation
[UIView beginAnimations:@"slideAnim" context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:duration];
//[UIView setAnimationCurve:curve];
[UIView setAnimationDidStopSelector:@selector(slideDone:finished:context:)];
[UIView setAnimationBeginsFromCurrentState:YES];
self.navigationController.navigationBar.userInteractionEnabled = NO; //for disabling Nav Buttons
[scrollView setScrollEnabled:NO];
if (inserting==ADDMODE) {
NSLog(@"ADD MODE Animation");
self.modeInSDel = ADDMODE;
CGAffineTransform transform = CGAffineTransformMakeTranslation(viewMoving.frame.size.width,0);
viewMoving.transform = transform;
// Commit the changes //
[UIView commitAnimations];
}
if (inserting==ENDREMOVEMODE) {
[viewMoving setAlpha:1];
NSLog(@"ENDMOVE MODE Animation %i",[viewMoving tag]);
self.modeInSDel = ENDREMOVEMODE;
viewMoving = [scrollView viewWithTag:(1+[viewMoving tag])];
//[viewMoving setAlpha:1];
NSLog(@"intial state: %f",viewMoving.frame.origin.x);
NSLog(@"actually moving View: %i",[viewMoving tag]);
CGAffineTransform transform = CGAffineTransformMakeTranslation(viewMoving.frame.size.width,0);
//CGAffineTransform transform = CGAffineTransformMakeTranslation(100,0);
viewMoving.transform = transform;
NSLog(@"moving to: %f",viewMoving.frame.origin.x);
[UIView commitAnimations];
}
}
if I want the movement to take a 6 seconds so that's why I'm not just scrolling there.
thanks all
Ian