我有一个带有绝对位置的按钮,用于表格。在KeyboardAvoidingView内部时,它位于其他元素之上
const BtnContainer = styled.View`
position: absolute;
bottom: 38px;
left: 16px;
width: ${Dimensions.get('window').width - 32};
`
<KeyboardAvoidingView
behavior="padding"
enabled
style={{ flex: 1 }}
keyboardVerticalOffset={60}
>
// form content
<BtnContainer>
<Button
text={getButtonLabel()}
disabled={!isButtonEnabled()}
onPress={stepChangeCallBack}
/>
</BtnContainer>
</KeyboardAvoidingView>
我尝试了behavior="position"
,但它破坏了所有布局,并且behavior="height"
也无效。
答案 0 :(得分:-1)
这似乎是一个简单的CSS问题。在底部添加较少的像素可能会成功。尝试bottom: 30px