我正在尝试使用flex创建一个双列网格.一列将用于显示单词或短语,第二列将用于翻译第一列.这是一个链接:http://imgur.com/nZGo8pb,让您了解我想要实现的目标.
我无法并排获得两列.我只能让我的话语出现在彼此之上.这是最好的尝试.一个巨大的失败.http://imgur.com/a/ICApr
我的代码是:
nent} from 'react';
import { Text, View,StyleSheet,Image,TextInput,ListView} from 'react-native';
class AddWords extends Component{
state = {words:['iku','konkai','kaikan'],
word:'',
EnglishWords:['go','this time','next time']
}
renderList(tasks){
return(
tasks.map((task) =>{
return(
<View key={task} style={styles.item}>
<Text>
{task}
</Text>
<Text>
</Text>
</View>
)
})
)
}
renderEnglishWords(english){
return(
english.map((english) =>{
return(
<View key={english} style={styles.item2}>
<Text>
{english}
</Text>
<Text>
</Text>
</View>
)
})
)
}
addWord(){
let words = this.state.words.concat([this.state.word]);
this.setState({words})
}
render(){
return(
<View style={styles.container}>
<TextInput
style={styles.input}
onChangeText={(word) => …Run Code Online (Sandbox Code Playgroud)