简体   繁体   中英

Objective C: Scrollview Issue

i have a scrollview inside a scrollview.

the mother scrollview has animations when the scrollview end decelerating and it working fine but when i started to scroll the inner scrollview it repeats the animations of the mother scrollview.

i am planning to put other function for the child scrollview when it ends decelerating.

here's the part of my code for the mother scrollView

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
    CGFloat pageWidth = 768;
    page = floor((self->motherScrollView.contentOffset.x - pageWidth / 2) / pageWidth) + 1;

    if (page == 2)
    {
        //animationOnEnter
    }
    else if (page == 3)
    {
        //animationOnEnter
    }
    else if (page == 4)
    {
        //animationOnEnter
    }
    else if (page == 5)
    {
        //animationOnEnter
    }
    else if (page == 6)
    {
        //animatiOnEnter
    }
    else if (page == 7)
    {
        //animationOnEnter
    }
    else if (page == 8)
    {
        //animationOnEnter
    }

//i haven't coded yet anything for the child scrollview because of this issue.

anyone? Thanks in advance :)

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
    CGFloat pageWidth = 768;
    if ([scrollView isEqual:motherScrollView]) {
     page = floor((self->motherScrollView.contentOffset.x - pageWidth / 2) / pageWidth) + 1;
.....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM