<View style = {commonStyle.safeView}>
<NavigationBarView onPressMenu = {this.onPressMenu.bind(this)} />
<KeyboardAvoidingView behavior="padding"style={styles.container} keyboardVerticalOffset = {50}>
<ScrollView style = {styles.sv} showsVerticalScrollIndicator = {false}>
<View style = {styles.main}>
<View style = {styles.view_input} >
<TextInput style = {{flex: 1, backgroundColor: 'white'}}
placeHolder = "输入"
onChangeText = {(text) => this.setToken(text) }
/>
</View>
<View style = {styles.view_input} >
</View>
<View style = {styles.view_input} >
</View>
<View style = {styles.view_input} >
</View>
<View style = {styles.view_input} >
</View>
<View style = {styles.view_input} >
</View>
<TouchableOpacity style = {styles.touchableOpacity} onPress = {this.onPressSubmit.bind(this)}>
<Text>submit</Text>
</TouchableOpacity>
</View >
</ScrollView>
</KeyboardAvoidingView>
</View>
keyboardVerticalOffset属性可以修正界面上移的偏差值。
export default StyleSheet.create({
main: {
flex: 1,
alignItems: 'center',
backgroundColor: 'gray',
},
sv: {
},
view_input: {
flex: 1,
alignSelf: 'stretch',
flexDirection: 'row',
margin: 10,
height: 40,
borderWidth: 1,
borderColor: 'yellow',
backgroundColor: 'red',
margin: 5,
},
touchableOpacity: {
width: 200,
height: 50,
flex: 1,
backgroundColor: 'blue',
alignItems: 'center',
justifyContent: 'center',
marginBottom: 5,
},
container: {
flex: 1,
backgroundColor: 'gray',
justifyContent: 'center',//
},
});