方法一:react-native-scrollable-tab-view
步骤:
1.安装下载:
npm install react-native-scrollable-tab-view --save
2.引入:
import ScrollableTabView , { ScrollableTabBar, DefaultTabBar } from "react-native-scrollable-tab-view"
3.使用:(render中直接使用即可)
<ScrollableTabView
// style={styles.container}
renderTabBar={()=> <DefaultTabBar />}
tabBarBackgroundColor='#fff'
tabBarActiveTextColor='#5ebfff'
tabBarInactiveTextColor='#333'
// tabBarUnderlineStyle={styles.lineStyle}
>
<Text tabLabel='@我的'>@我的11</Text >
<Text tabLabel='回复我的'> 回复我的11</Text >
</ScrollableTabView>
方法二:react navigation
步骤:
1.引入:(react navigation中的组件以及所要跳转的组件)