gpt4 book ai didi

scroll - 文本输入占位符在 native react 中下降

转载 作者:行者123 更新时间:2023-12-02 03:16:09 24 4
gpt4 key购买 nike

在我的 React Native 应用程序中,当我按下文本输入时,占位符会向下移动一点,如下图所示。我们该如何解决这个问题?只需触摸并滚动屏幕即可实现此更改。带或不带 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]: /image/Cq2wx.png

最佳答案

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


<TextInput style={{margin:0,padding:0}} placeholder="place holder"/>

关于scroll - 文本输入占位符在 native react 中下降,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56088303/

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