我正在调整表格 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/