React Native 导航栏:react-native-navbar

fpcm 9年前

react-native-navbar 是用于 React Native 上简单的定制化导航栏。

示例代码:

var NavigationBar = require('react-native-navbar');  var ExampleProject = React.createClass({      renderScene: function(route, navigator) {          var Component = route.component;          var navBar = route.navigationBar;          if (navBar) {        navBar = React.addons.cloneWithProps(navBar, {navigator: navigator,          route: route        });      }    return (<View style={styles.navigator}>          {navBar}<Component navigator={navigator} route={route} />        </View>      );    },  render: function() {return (<Navigator          style={styles.navigator}          renderScene={this.renderScene}          initialRoute={{            component: InitialView,            navigationBar: <NavigationBar title="Initial View"/>          }}        />      );    }  });

项目主页:http://www.open-open.com/lib/view/home/1430541138802