Reactjs 固定位置f
嗨,我是新来的。我想问一下如何固定这三种颜色的位置,因为每次我试图点击搜索文本输入,键盘向上移动时,这三种颜色也会向上移动。我尝试了Reactjs 固定位置f,reactjs,react-native,Reactjs,React Native,嗨,我是新来的。我想问一下如何固定这三种颜色的位置,因为每次我试图点击搜索文本输入,键盘向上移动时,这三种颜色也会向上移动。我尝试了位置:“已修复”,但它不起作用 代码如下: render(){ return( <View style={{flex: 1}}> <View style={{flex: 3, backgroundColor: '#E1F1FE'}}> <View style={styles.for
位置:“已修复”
,但它不起作用
代码如下:
render(){
return(
<View style={{flex: 1}}>
<View style={{flex: 3, backgroundColor: '#E1F1FE'}}>
<View style={styles.form}>
<TextInput
style={styles.input}
placeholder = "Search"
returnKeyType="go"
underlineColorAndroid={'rgba(0,0,0,0)'}
/>
<Icon name="search" size={20} color="#900" style={styles.label} />
</View>
</View>
<View style={{flex: 1, backgroundColor: '#77D3F8'}}>
</View>
<View style={{flex: 1, backgroundColor: '#AEEAF2'}}>
</View>
<View style={{flex: 1, backgroundColor: '#39CFDE'}}>
</View>
</View>
);
}
提前感谢:)当键盘激活时,它将不会被固定到位置。您可能需要使用或其他类似的软件包,以便在键盘激活时设计不会受到干扰。当键盘激活时,它不会粘在位置上。您可能需要使用或其他类似的软件包,以便在激活键盘时不会干扰设计。显示屏幕截图显示屏幕截图
import {StyleSheet} from 'react-native';
module.exports = StyleSheet.create({
navBar: {
backgroundColor: '#EAEAEC',
},
title: {
color: '#rgba(0, 0, 0, 0.65)',
},
buttonText: {
color: '#rgba(0, 0, 0, 0.45)',
},
style3:{
fontSize: 35,
color: '#fff',
padding: 10,
alignContent:'center',
justifyContent: 'center',
},
style2: {
flexDirection: 'row',
alignContent: 'center',
alignItems: 'center',
flex:1
},
buttonstyle: {
flex: 1
},
form:{
flexDirection: 'row',
borderBottomWidth:1,
borderColor: '#00BBD1',
marginTop:80,
marginRight: 40,
marginLeft: 40,
alignContent: 'center',
alignItems: 'center',
},
input: {
height: 40,
borderWidth: 0,
flex: 1
},
label:{
alignContent:'center',
justifyContent: 'center',
marginRight: 10,
color: '#00BBD1'
},
});