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

标签 android react-native scrollview textinput

我正在创建一个表单,它的样式在左侧有标签,在右侧有 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/

相关文章:

android - 通知中的字符串未更新

ios - 如何更改位置警报中的博览会名称

javascript - React Native 中的条件样式

iOS:调整 UIWebView 的高度 - 奇怪的行为

iphone - 我在 UIScrollView 中有一个 UIView。如何引用父 UIScrollView?

java - ObjectAnimator 断断续续的滚动

java - 从 Android 与远程 CouchDB 服务器对话

android:通过 php 连接 mysql(WAMP 设置)- 应用程序崩溃

react-native - 你如何在 native react 中使用 ScrollView 内的 FlatList

android - 如何在 Kotlin 中自定义 Android Studio 的导入顺序以忽略它们是否是 "static"导入?