ReactNative中的选项卡'react-native-scrollable-tab-view'

如下效果的界面的搭建,可以借助开源的'react-native-scrollable-tab-view'


ReactNative中的选项卡'react-native-scrollable-tab-view'_第1张图片
react-native-scrollable-tab-view.gif
1.打开终端,进入到项目的根目录下,添加'react-native-scrollable-tab-view'
npm install 'react-native-scrollable-tab-view'
2.在使用的js文件中导入
import ScrollableTabView from 'react-native-scrollable-tab-view';
3.

导入我们创建的四个js文件

import LatestRecord from './LatestRecord';  //最新收录
import LatestComment from './LatestComment';//最新评论
import HotTopic from './HotTopic';//热门
import Member from './Member';//成员

react-native-scrollable-tab-view主要实现

 {
                         Keyboard.dismiss()
                     }}>//切换tab时候调用
                    
                    
                    
                    

                

如果还需要其他设置可以参照,react-native-scrollable-tab-view官网 。

你可能感兴趣的:(ReactNative中的选项卡'react-native-scrollable-tab-view')