首次进入页面的时候,ScrollableTabBar没有underline的样式,点击切换之后才会出现
来源:5-4 Popular(最热)模块的列表页面实现-3
课桌上刻着的
2017-11-01
写回答
2回答
-
慕粉1118086210
2018-04-20
我在github上找个答案,成功解决我上面的这个问题
https://github.com/skv-headless/react-native-scrollable-tab-view/commit/4312d6cca2fe7859caa5219f2ee8b61edcf04884
00 -
CrazyCodeBoy
2017-11-03
手动设置一下tabBarUnderlineStyle,可以参考下面的代码:
let content = this.state.languages.length > 0 ? <ScrollableTabView tabBarUnderlineStyle={{backgroundColor: '#e7e7e7', height: 2}} tabBarInactiveTextColor='mintcream' tabBarActiveTextColor='white' ref="scrollableTabView" tabBarBackgroundColor={this.state.theme.themeColor} initialPage={0} renderTabBar={() => <ScrollableTabBar style={{height: 40, borderWidth: 0, elevation: 2}} tabStyle={{height: 39}}/>} > {this.state.languages.map((reuslt, i, arr)=> { let language = arr[i]; return language.checked ? <PopularTab key={i} tabLabel={language.name} {...this.props}/> : null; })} </ScrollableTabView> : null;
022018-09-20
相似问题