gpt4 book ai didi

android - React Native Android - 如何能够滚动 TextInput

转载 作者:搜寻专家 更新时间:2023-11-01 08:23:05 25 4
gpt4 key购买 nike

我正在创建一个表单,它的样式在左侧有标签,在右侧有 TextInputs 作为要求。所以我遇到的问题是当您以某种方式触摸 TextInput 时无法滚动。大多数用户使用右侧滚动,所以这对我来说是一个主要问题。您有什么想法可以解决这个问题吗?

样式的示例代码以防万一或者人们可能会找到有用的东西

<View style={{ flexDirection: 'row', marginTop: 10, justifyContent: 'center', alignItems: 'center' }} >
<View style={{ justifyContent: 'center', alignSelf: 'center', alignItems: 'center', width: W, height: HEIGHT / 18, borderWidth: 1 }}>
<Text adjustsFontSizeToFit
style={{ textAlign: 'center', color: 'black', }} >
Telefon Numarası
</Text>
</View>
<TextInput
ref={(node) => { this.phoneNumber = node; }}
dataDetectorTypes={['phoneNumber']}
blurOnSubmit={false}
keyboardType={'phone-pad'}

defaultValue={this.props.data.plateInformation != null ? this.props.data.plateInformation.phoneNumber : ''}
returnKeyType={'go'}
onChangeText={this.props.changePhoneNumber}
keyboardAppearance={'dark'}
returnKeyLabel={'Devam'}
onSubmitEditing={() => this.carBrand.focus()}
style={{ color: 'green', textAlign: 'center', borderWidth: 1, width: W, height: HEIGHT / 18, margin: 'auto' }}
/>
</View>

最佳答案

出于某种原因,这对我有用:multiline={true}

不太清楚为什么。更奇怪的是,如果您还有 keyboardType='numeric',它将无法工作。

关于android - React Native Android - 如何能够滚动 TextInput,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48295309/

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