文本输入占位符在本机响应中下降

问题描述 投票:0回答:1

在我的本机应用程序中,当我按下文本输入时,占位符下降了一点,如下图所示。我们该如何解决呢?只需触摸并在屏幕上滚动即可进行此更改。带有或不带有scrollview都不起作用

enter image description here

> below is my code
           <ScrollView>
          <View style={styles.Seventh}>
            <View style={styles.Eighth}>
              <Image style={styles.Imagethird} source={require('../src/Assets/Profile-xhdpi.png')} />
            </View>
            <View style={styles.ninth}>
              <Text style={styles.Textthird}>USER'S NAME</Text>
              <TextInput placeholder="user's name               " style={styles.one} underlineColorAndroid='transparent'
            //--------------value Handler----------------//
            onChangeText={(firstName) => this.setState({firstName})}

            //---------------------------------//
              />
            </View>
            </View>
            </ScrollView>
            Seventh: {
                height: 60,
                width: '100%',
                borderRadius: 70,
                flexDirection: 'row',
                elevation: 3,
                backgroundColor: 'white',
                marginTop:10
            },
            Eighth: {
                height: 60,
                width: '20%',
                justifyContent: 'center',
                alignItems: 'center'
            },
            Imagethird: {
                height: 20,
                width: 20,
                resizeMode: 'contain',
            },
            ninth: {
                height: 60,
                width: '80%',

            },
            Textthird: {
                marginRight:29,
                marginTop: 10,
                fontSize: 12,
                color: '#C7C7CD'
            },one:{
        marginBottom:25,
        fontWeight:'bold',
     }


  [1]: https://i.stack.imgur.com/Cq2wx.png
react-native scroll react-native-android placeholder textinput
1个回答
1
投票

我认为问题出在空白处。我也遇到了这个问题,并且发现文本输入具有默认的空白值,请尝试将空白设置为0,

© www.soinside.com 2019 - 2024. All rights reserved.