首页 > 解决方案 > 按下 InputText 后 ImageBackground 移动

问题描述

您好,我刚开始使用 React Native,我想使用图像作为背景,但是当按下输入文本时,图像会向上移动一点,我想修复它。

const backgroundImage = './assets/background-blur.jpg'

const App = () => {
    return (
        <View>
            <ImageBackground source={require(backgroundImage)} style={style.background}>
                <ScrollView>
                    <SearchInput />
                </ScrollView>
            </ImageBackground>
        </View>
    )
}

const style = StyleSheet.create({
    background: {
        width: '100%',
        height: '100%'
    }
})

有什么建议吗?

标签: react-native

解决方案


推荐阅读