gpt4 book ai didi

javascript - React-Native - KeyboardAvoidingView - 错误

转载 作者:行者123 更新时间:2023-11-29 21:05:16 29 4
gpt4 key购买 nike

我使用 keyboardAvoidingView 来显示输入并使用下一个焦点。但是,当我点击第一个输入(打印标签 1623 - Acidez)时,这是隐藏的。如何显示这个?

enter image description here enter image description here

<ReactNative.View key={this.state.selectedTabIndex}>
<ReactNative.ScrollView style={{ height: this.props.styles.height - 40 }}>

<ReactNative.KeyboardAvoidingView
keyboardVerticalOffset={0}

behavior="position"
contentContainerStyle={{ paddingTop: this.state.size }}
>
{this.tabs[this.state.selectedTabIndex].render()}
</ReactNative.KeyboardAvoidingView>

</ReactNative.ScrollView>
</ReactNative.View>

最佳答案

如果你将 'keyboardVerticalOffset' 增加到更大的值,比如 KeyboardAvoidingView 的 '100' 到更大的数量,它会从键盘向上滚动从而避免它。我也花了很多时间在互联网上找到正确的解决方案但最终自己弄清楚了对于'react-native'版本'0.50.4'。我让它像这样工作

<View style={…..}>
<ScrollView>
<KeyboardAvoidingView style={{ flex: 1 }}
keyboardVerticalOffset={100} behavior={"position"}>

</KeyboardAvoidingView>
</ScrollView>
</View>

关于javascript - React-Native - KeyboardAvoidingView - 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44420906/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com