views:

62

answers:

1

hi,

my view hierachy is following:

BigView
- UIScrollView
  - View 1
  - View 2
  - View 3
- UIView
  - UIButton

now i want, that when i press the UIButton, the BigView (which includes the button as well) moves 100px to the top (so parts of the BigView aren't visible any longer) and another UIView gets visible at the free space under the BigView.

You get the problem? :)

How can I achieve this?

Thanks in advance!

+2  A: 

Just do a UIView animation in the method you call when the button is clicked:

[UIView beginAnimations:@"MoveView" context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationDuration:0.5f];
self.BigView.frame = CGRectMake(newXPoistion, newYPosistion, samewidth, sameheight);
[UIView commitAnimations];  

That will animate the bigview to the new cooridinates you give and should move everything within that view aswell

octermircty
thank you, works perfectly :)
Tronic