子视图从屏幕底部向上滑动

时间:2012-06-06 04:25:01

标签: iphone ios uiview addsubview

我正在尝试创建一个动画,这是我放入屏幕视图之外的视图框架中的视图。然后我想将它从当前帧位置动画到屏幕上方的新位置...

目前我的代码看起来像这样

//..
ButtonOneViewController *b1VC = [[ButtonOneViewController alloc] initWithNibName:@"ButtonOneViewController" bundle:[NSBundle mainBundle]];

    UIView *animatedActionView = [[UIView alloc] initWithFrame:CGRectMake(10.0, 490.0, 300.0, 380.0)]; //off screen
    [animatedActionView addSubview:b1VC.view];
    [otherNav.view insertSubview:animatedActionView belowSubview:tbView];
// what do I do to animate it up to a position of (10.0, 10.0, 300.0, 380.0)

任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:4)

试试这个:

[UIView beginAnimations:nil context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
//Change your frame here.
[UIView commitAnimations];