gpt4 book ai didi

objective-c - 隐藏动画模态 UIView?

转载 作者:行者123 更新时间:2023-11-29 13:27:38 25 4
gpt4 key购买 nike

我需要以模态方式呈现然后关闭 UITableView。它应该从顶部到按钮进行动画处理。但它不应该覆盖整个屏幕,它会从导航栏下方滑入并在到达标签栏之前停止。

所以我不能将 presentViewController:animated:completion: 用于它的 View Controller 。我需要将其作为 View 层次结构的一部分进行操作。问题是,这个 TableView 不可见时应该放在哪里。我将从哪里制作动画?

最佳答案

您可以将 UITableView 放在 UIView 中并使用 animateWithDuration。例如(使用一些组成的维度):

[subMenuView setFrame:CGRectMake(5,-400, 310, 400)];

[UIView animateWithDuration:0.8f
delay:0.0f
options:UIViewAnimationOptionTransitionCurlDown
animations:^{
[subMenuView setFrame:CGRectMake(5,0,310,400)];
}
completion:^ (BOOL finished)
{
if (finished)
{
//animation has finished, you can do something here, even another nested animation
}
}];

如果你想再向上滑动它,做相反的事情......

关于objective-c - 隐藏动画模态 UIView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12709317/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com