Objective C: UIScrollView (pagingEnabled): 当下一页进入时开始动画 [英] Objective C: UIScrollView (pagingEnabled): When Next Page Enters Start The Animation

查看:22
本文介绍了Objective C: UIScrollView (pagingEnabled): 当下一页进入时开始动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,我不知道在那里写什么.

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

但后来我发现当滚动视图 pagingEnabledYES 时它不起作用.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆