File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ const ScrollableTabView = React.createClass({
3434 renderTabBar : PropTypes . any ,
3535 style : View . propTypes . style ,
3636 contentProps : PropTypes . object ,
37+ scrollWithoutAnimation : PropTypes . bool
3738 } ,
3839
3940 getDefaultProps ( ) {
@@ -44,6 +45,7 @@ const ScrollableTabView = React.createClass({
4445 onChangeTab : ( ) => { } ,
4546 onScroll : ( ) => { } ,
4647 contentProps : { } ,
48+ scrollWithoutAnimation : false
4749 } ;
4850 } ,
4951
@@ -67,11 +69,16 @@ const ScrollableTabView = React.createClass({
6769 if ( Platform . OS === 'ios' ) {
6870 const offset = pageNumber * this . state . containerWidth ;
6971 if ( this . scrollView ) {
70- this . scrollView . scrollTo ( { x : offset , y : 0 , } ) ;
72+ this . scrollView . scrollTo ( { x : offset , y : 0 , animated : ! this . props . scrollWithoutAnimation } ) ;
7173 }
7274 } else {
7375 if ( this . scrollView ) {
74- this . scrollView . setPage ( pageNumber ) ;
76+ if ( this . props . scrollWithoutAnimation ) {
77+ this . scrollView . setPageWithoutAnimation ( pageNumber ) ;
78+ }
79+ else {
80+ this . scrollView . setPage ( pageNumber ) ;
81+ }
7582 }
7683 }
7784
You can’t perform that action at this time.
0 commit comments