diff --git a/ScrollableTabBar.js b/ScrollableTabBar.js index 1500b2db..81b7d872 100644 --- a/ScrollableTabBar.js +++ b/ScrollableTabBar.js @@ -104,8 +104,9 @@ const ScrollableTabBar = createReactClass({ } }, - + prevPageOffset: 0,//解决 flash 闪屏问题 updateTabUnderline(position, pageOffset, tabCount) { + if(pageOffset==this.prevPageOffset) return const lineLeft = this._tabsMeasurements[position].left; const lineRight = this._tabsMeasurements[position].right; @@ -122,6 +123,7 @@ const ScrollableTabBar = createReactClass({ this.state._leftTabUnderline.setValue(lineLeft); this.state._widthTabUnderline.setValue(lineRight - lineLeft); } + this.prevPageOffset = pageOffset }, renderTab(name, page, isTabActive, onPressHandler, onLayoutHandler) {