Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.5k views
in Technique[技术] by (71.8m points)

react-native - 文本输入占位符在本地响应中下降(Text input placeholder going down in react native)

In my react native app when I press the text input the placeholder is going down a little bit as shown in the image below.

(在我的react native应用程序中,当我按下文本输入时,占位符下降了一点,如下图所示。)

how can we fix this?

(我们该如何解决呢?)

a simple touch and scroll on screen making this change.

(只需触摸并在屏幕上滚动即可进行此更改。)

with or without scrollview its not working

(有或没有scrollview它不起作用)

在此处输入图片说明

> 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
  ask by Stv News Kaipamangalam translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

我认为问题出在边距上。我也遇到了这个问题,发现文本输入具有默认边距值,请尝试将边距设置为0,


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...