12207480 / TYPagerController

page scroll view and controller,simple,high custom,and have many tabBar styles,,support Objective-C and swift
MIT License
1.37k stars 231 forks source link

传入参数为animate,但是实际动画参数直接使用了NO #40

Closed Alex1989Wang closed 7 years ago

Alex1989Wang commented 7 years ago

https://github.com/12207480/TYPagerController/blob/f613d6f640ea7f4efb91abb7bb7e64215cd2a1e8/TYPagerControllerDemo/TYPagerController/TYPagerViewLayout.m#L265

是不是应该修改为: [_scrollView setContentOffset:CGPointMake(index * CGRectGetWidth(_scrollView.frame),0) animated:animate];

12207480 commented 7 years ago

这个是故意设置成NO,因为 目标页面相隔很多页 如果用动画效果会不好

Alex1989Wang commented 7 years ago

如果这样的话,直接使用TYPagerViewLayout和TYPagerView,来调用这个接口就不会有动画哦

12207480 commented 7 years ago

是的

pcjbird commented 7 years ago

那能不能改成相隔超过一页再设成NO呢,这样相邻的两页切换效果貌似也不好啊!!!

pcjbird commented 7 years ago

[_scrollView setContentOffset:CGPointMake(index * CGRectGetWidth(_scrollView.frame),0) animated:labs(_curIndex - index) > 1 ? NO : animate];

12207480 commented 7 years ago

这个可以