gpt4 book ai didi

ios - 动画内容插图

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:02:01 24 4
gpt4 key购买 nike

我想为属于 UIWebView 的 scrollView 的 contentInset 设置动画。我尝试了下面的代码,但不幸的是 inset 在运行时只是跳转

UIViewAnimationOptions options = UIViewAnimationOptionBeginFromCurrentState;
[UIView animateWithDuration:10.0 delay:0 options:options animations:^
{
self.webView.scrollView.contentInset = UIEdgeInsetsMake(100 ,120,120,120);
}
completion:nil];

有谁知道如何制作流畅的 contentInset 动画?我还尝试了 AllowAnimatedContent 选项,但没有成功

最佳答案

尝试这样的事情:

CGFloat height = 80.0f //change to whichever value you want

[UIView animateWithDuration:0.2 animations:^{
[self.peopleCollectionView setContentInset:UIEdgeInsetsMake(height, 0, 0, 0)];
}];
[self.peopleCollectionView setContentOffset:CGPointMake(0, -height) animated:YES];

关于ios - 动画内容插图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28764191/

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