Tag: 导航器

在NavigatorIOS – React Native中调用onRightButtonPress的函数

我在反应原生NavigatorIOS中使用onRightButton。 我希望能够调用一个驻留在我所推的组件中的函数,但是我不知道如何实现这个function。 这是一个代码示例: this.props.navigator.push({ component: SingleResultView, title: "SomeTitle", rightButtonIcon: require('image!mapsmarker'), passProps: { userPosition: this.props.userPosition }, onRightButtonPress: () => { SingleResultView.foo(); } // NOT WORKING! }); 我怎样才能做到这一点?

反应本机导航 – 屏幕总是空白

我试图按照示例( https://github.com/facebook/react-native/tree/master/Examples/UIExplorer/Navigator )在本地反应网站设置我的导航,但我似乎无法得到它的工作。 无论我怎么做,GoogSignIn场景总是空白,虽然它同时击中了我的console.log文件中的两个点。 我已经尝试在我的应用程序中将起点切换到不同的场景,但同样的事情总是发生。 我认为这是我在我的导航器index.ios.js做错了,但我不知道是什么。 任何帮助深表感谢。 index.ios.js 'use strict'; var React = require('react-native'); var DataEntry = require('./app/DataEntry'); var PasswordView = require('./app/PasswordView'); var GoogSignIn = require('./app/GoogSignIn'); var { AppRegistry, Image, StyleSheet, Text, View, Navigator, TouchableOpacity, } = React; class PasswordRecovery extends React.Component { render() { return ( <Navigator ref={this._setNavigatorRef} style={styles.container} initialRoute={{id: 'GoogSignIn', name: 'Index'}} renderScene={this.renderScene} […]

使用滑动菜单和导航器的Onsen-UI

好的,问题是我有一个页面工作滑动菜单。 现在我的一个网页上有一个名单。 通过点击ons-list-item我想用后退button导航到一个新的页面。 我到处search,但没有find适当的解决我的问题。 这是我的代码。 <ons-sliding-menu menu-page="menu.html" main-page="home.html" side="left" var="menu" type="reveal" max-slide-distance="260px" swipable="true"> </ons-sliding-menu> <ons-template id="menu.html"> <ons-page modifier="menu-page"> <ons-toolbar modifier="transparent"></ons-toolbar> <ons-list class="menu-list"> <ons-list-item class="menu-item" ng-click="menu.setMainPage('home.html', {closeMenu: true})"> <ons-icon icon="fa-plus"></ons-icon> Home </ons-list-item> <ons-list-item class="menu-item" ng-click="menu.setMainPage('browsehotels.html', {closeMenu: true})"> <ons-icon icon="fa-bookmark"></ons-icon> Browse Hotels </ons-list-item> <ons-list-item class="menu-item" ng-click="menu.setMainPage('specialoffers.html', {closeMenu: true})"> <ons-icon icon="fa-bookmark"></ons-icon> Special Offers <div class="notification menu-notification">3</div> </ons-list-item> <ons-list-item […]

React Native,NavigatorIOS,undefined不是一个对象(评估'this.props.navigator.push')

我试图使用NavigatorIOS所以在我的index.ios.js我得到了: 'use strict'; var React = require('react-native'); var Home = require('./App/Components/Home'); var { AppRegistry, StyleSheet, NavigatorIOS } = React; var styles = StyleSheet.create({ container:{ flex: 1, backgroundColor: '#111111' } }); class ExampleApp extends React.Component{ render() { return ( <NavigatorIOS style={styles.container} initialRoute={{ title: 'example', component: Home }} /> ); } }; AppRegistry.registerComponent('exampleapp', () => ExampleApp); module.exports […]