内の別の画面が オープンは、私は、この画面を持って反応し、ネイティブ
ネイティブ
import React, { Component } from 'react';
import { AppRegistry,TouchableOpacity, Text ,Button,Image,TextInput,PropTypes,StyleSheet,View,NavigatorIOS,TouchableHighlight} from 'react-native';
class LoginView extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.title}>
HYGEX
</Text>
<View>
<TextInput
placeholder="Username"
style={styles.formInput}
/>
<TextInput
placeholder="Password"
secureTextEntry={true}
style={styles.formInput1}
/>
<TouchableHighlight style={styles.button}
onPress={() => this.move()}>
<Text style={styles.buttonText}>Login</Text>
</TouchableHighlight>
</View>
</View>
);
}
move() {
//what i can do here to go to Socrce screen ???
}
}
を反応させ、ログイン画面のようなもの、私は
TouchableHighlight
にクリックしたときに、今私は、この画面を開く必要があり
'use strict';
import React, { Component } from 'react';
import { AppRegistry, ListView, Text, View } from 'react-native';
class HygexListView extends Component {
constructor(props) {
super(props);
const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
this.state = {
dataSource: ds.cloneWithRows([
'John', 'Joel', 'James', 'Jimmy', 'Jackson', 'Jillian', 'Julie', 'Devin'
])
};
}
render() {
return (
<View style={{flex: 1, paddingTop: 22}}>
<ListView
dataSource={this.state.dataSource}
renderRow={(rowData) => <Text>{rowData}</Text>}
/>
</View>
);
}
}
module.exports = HygexListView;
I moveメソッドを実装しようとしましたが、失敗しました!どんな考え?
react-nativeには、TouchableHighlight
にクリックすると画面を変更する方法がありますか?
私はこれを試しましたが、私の場合はこれを適用することはできません –
どうしてですか?もっと詳しい情報を提供してください... –
私は多くの例を試してみて、いつも私はこのメソッドを実装する方法を知っていれば、props.this.novigatorなどでエラーを受け取ります。 –