如何将 ScrollView 与 react-native-router-flux 和 Grid、Col、Row 一起使用
how to use ScrollView with react-native-router-flux and Grid,Col,Row
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>
我有这个屏幕布局1:
而不是:
谢谢。
你应该这样编写代码:
<View style={{marginTop: 50, }}>
<ScrollView>
//Hir your code... Row,col...
</ScrollView>
</View>
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>
我有这个屏幕布局1:
而不是:
谢谢。
你应该这样编写代码:
<View style={{marginTop: 50, }}>
<ScrollView>
//Hir your code... Row,col...
</ScrollView>
</View>