这是一个点击切换的demo
先看效果 然后看实现的代码import React from 'react';import { Text, View } from 'react-native';import { createBottomTabNavigator, createAppContainer, FlatList } from 'react-navigation';const data = new Array(30).fill(0);//homeclass HomeScreen extends React.Component { render() { return (); }}//settingsclass SettingsScreen extends React.Component { render() { return ( Home - {index} } contentContainerStyle={ { padding: 10 }} />); }}const TabNavigator = createBottomTabNavigator({ Home: { screen: HomeScreen }, Settings: { screen: SettingsScreen },});export default createAppContainer(TabNavigator); ( Settings - {index} )} contentContainerStyle={ { padding: 10 }} />
demo自: