gpt4 book ai didi

iphone - 如何为我的 View 调整大小设置动画?

转载 作者:搜寻专家 更新时间:2023-10-30 19:53:44 25 4
gpt4 key购买 nike

我正在调整表格 headerView 的大小。我想为它制作动画,但我不确定怎么做。

-(void)layoutForBanner
{
// Depending on if the banner has been loaded, we adjust the content frame and banner location
// to accomodate the ad being on or off screen.
// This layout is for an ad at the bottom of the view.
if(banner.bannerLoaded)
{
headerView.frame = CGRectMake(0, 0, 320, 94);
}
else
{
headerView.frame = CGRectMake(0, 0, 320, 50);
}

[self.tableView setTableHeaderView:headerView];

}

最佳答案

这应该可以解决问题。

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:.5];
headerView.frame = CGRectMake(0, 0, 320, 50);
[UIView commitAnimations];

关于iphone - 如何为我的 View 调整大小设置动画?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3713562/

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