如何使用ScrollView与react-native-router-flux和Grid,Col,Row

时间:2017-04-21 16:40:56

标签: react-native grid flexbox scrollview react-native-router-flux

ScrollView无法在react-native-router-flux上运行!

index.js:

<Router>
<Scene
key="root">
<Scene key="layout2" component={layout2} title="Layouttwo" />
<Scene key="Layout1" component={Layout1} title="layouOne" />
</Scene>
</Router>

布局1:

<ScrollView>

  <Grid>
  <Row>
  <Col>
  <Text onPress={Actions.Layout1}>Bonjour Sofiane!</Text>
  </Col>
  <Col>
  <ListView dataSource={this.state.table1Source} renderRow={this.renderRowtable1.bind(this)} enableEmptySections={true} />
  </Col>

  </Row>
  <Row>
  <Col>
  <TextInput  placeholder="Input1" onChangeText={(text) => this.setState({Input1: text})} value={this.state.Input1}/>
  </Col>

  <Col>
  <Button title='Ajouter' onPress={() => this.remlirTable()} onLongPress={() => this.alerte()}/>
  </Col>
</Row>
  </Grid>
</ScrollView>

我有这个screan layout1: enter image description here

而不是:

enter image description here

感谢。

1 个答案:

答案 0 :(得分:0)

你应该像这样编写代码:

  <View style={{marginTop: 50, }}>
      <ScrollView>

    //Hir your code... Row,col...

     </ScrollView>
   </View>