问题描述
限时送ChatGPT账号..对不起,我不知道在那里写什么.
I'm sorry for the title i don't know what to write there.
我有一个包含许多页面的滚动视图,并且在每个页面中都有不同的动画,当用户切换到该页面时应该开始.
I have a scrollView with many pages and in each page there are different animations that should start when the user switch to that page.
我试过这个:
if (CGPointEqualToPoint (CGPointZero, CGPointZero))
{
//start animation
}
它只对第一页有效
当我将其更改为下一页的 CGPointEqualToPoint (CGPointMake (768, 0), CGPointZero)
时,它不起作用.
when i changed it to CGPointEqualToPoint (CGPointMake (768, 0), CGPointZero)
for the next page, it's not working.
我正在尝试使用这个`
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
但后来我发现当滚动视图 pagingEnabled
为 YES
时它不起作用.
but then i found out that it is not working when the scrollview pagingEnabled
is YES
.
推荐答案
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
通过使用滚动视图的这种委托方法,您可以在第一页完成滚动时获得,并且通过保持条件可以开始动画.
by using this delegate method of scroll view you can get when your first page finish scrolling and by keeping conditions you can start animation.
这篇关于Objective C: UIScrollView (pagingEnabled): 当下一页进入时开始动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论