Sar*_*Vin 1 android react-native
我有 android 和滚动视图的问题。我想在软键盘打开时看到文本输入。
所以我使用这个组件 => https://github.com/sarovin/react-native-scrollview-smart
但问题是导航栏没有固定在顶部而是消失了......
导航栏是 react-native-router-flux => https://github.com/aksonov/react-native-router-flux 的一个组件
有什么建议吗?
谢谢
使用 react native 的键盘避免视图 KeyboardAvoidingView和Example Like
import {ScrollView, Text, TextInput, View, KeyboardAvoidingView} from "react-native";
Run Code Online (Sandbox Code Playgroud)
并在渲染函数中嵌套View和TextInput
<ScrollView style={styles.container}>
<KeyboardAvoidingView behavior='position'>
<View style={styles.textInputContainer}>
<TextInput
value={pin}
style={styles.textInput}
keyboardType='default'
returnKeyType='next'
onChangeText={this.handleChangePin}
underlineColorAndroid='transparent'
placeholder={I18n.t('pin')}/>
</View>
</KeyboardAvoidingView>
</ScrollView>
Run Code Online (Sandbox Code Playgroud)
它会照顾到
| 归档时间: |
|
| 查看次数: |
2914 次 |
| 最近记录: |