Hello ,
I'm using this method to try to move my view up but without success, this is the code in my MainViewController implementation file :
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
CGRect rect = self.view.frame;
if (movedUp)
{
NSLog(@"should move Up");
rect.origin.y -= 50;
rect.size.height += 300;
}
self.view.frame = rect ;
[UIView commitAnimations];
It is not erroring out and it's printing out "should move Up" so I know that the method is executed properly .
This is the IB hierarchy ( I`m trying to move the highlighted View) :
Any help would be greatly appreciated, I`m running out of ideas ..
Ok, Editing here I've isolated the problem to be something else, I'm using this code now :
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:.5];
self.containerView.frame = CGRectMake(0, 0, 250, 50);
[UIView commitAnimations];
and if I injecting this code in "- (void)viewDidLoad" it's working fine .
but if I use the same code in a different function in the same ViewController implementation file , it's not working :
- (void)setViewMovedUp:(BOOL)movedUp {
NSLog(@"test movedUp");
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:.5];
self.containerView.frame = CGRectMake(0, 0, 250, 50);
[UIView commitAnimations];
}
BUT it's still printing out "test moved up" so the code is executed, just the view not animating .