subView Slide up from bottom of the screen

2019-07-17 01:55发布

I am trying to create an animation that is a view i have put into a view frame outside of the screen view. Then I would like to animate it from the current frame location to a new location higher up the screen...

currently my code looks like this

//..
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)

any help would be greatly appreciated.

1条回答
家丑人穷心不美
2楼-- · 2019-07-17 02:31

Try this:

[UIView beginAnimations:nil context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
//Change your frame here.
[UIView commitAnimations];
查看更多
登录 后发表回答