import React from 'react';
import {
registerComponent,
} from 'react-native-playground';
import {
StatusBar,
StyleSheet,
Text,
View,
} from 'react-native';
class App extends React.Component {
render() {
return (
<View>
<View style={{height:50,flexDirection:'row',flex:1,borderWidth:1,padding:2,justifyContent:'space-around'}}>
<View style={{flex:1,borderWidth:1,alignItems:'center',justifyContent:'center'}}>
<Text>Jill</Text>
</View>
<View style={{flex:1,borderWidth:1,alignItems:'center',justifyContent:'center'}}>
<Text>Smith</Text>
</View>
<View style={{flex:1,borderWidth:1,alignItems:'center',justifyContent:'center'}}>
<Text>50</Text>
</View>
</View>
<View style={{height:50,flexDirection:'row',flex:1,borderWidth:1,padding:2,justifyContent:'space-around'}}>
<View style={{flex:1,borderWidth:1,alignItems:'center',justifyContent:'center'}}>
<Text>Eve</Text>
</View>
<View style={{flex:1,borderWidth:1,alignItems:'center',justifyContent:'center'}}>
<Text>Jackson</Text>
</View>
<View style={{flex:1,borderWidth:1,alignItems:'center',justifyContent:'center'}}>
<Text>94</Text>
</View>
</View>
<View style={{height:50,flexDirection:'row',flex:1,borderWidth:1,padding:2,justifyContent:'space-around'}}>
<View style={{flex:1,borderWidth:1,alignItems:'center',justifyContent:'center'}}>
<Text>First Name</Text>
</View>
<View style={{flex:1,borderWidth:1,alignItems:'center',justifyContent:'center'}}>
<Text>Last Name</Text>
</View>
<View style={{flex:1,borderWidth:1,alignItems:'center',justifyContent:'center'}}>
<Text>Age</Text>
</View>
</View>
</View>
);
}
}
registerComponent(App);
這裏反應母語一樣的The工作代碼https://rnplay.org/apps/e3MZAw
如何結合ListView?我需要ListView從其他api獲取數據源 –