React native 如何将按钮容器放置在react native中可拖动模式框的底部?
我有一个有一些内容的模式框,底部有一个有两个按钮的按钮容器。我希望按钮容器始终相对于屏幕/视口。现在棘手的部分是模态盒是可拖动的。我可以上下移动,但高度保持100% 现在如果我给出React native 如何将按钮容器放置在react native中可拖动模式框的底部?,react-native,react-native-modal,React Native,React Native Modal,我有一个有一些内容的模式框,底部有一个有两个按钮的按钮容器。我希望按钮容器始终相对于屏幕/视口。现在棘手的部分是模态盒是可拖动的。我可以上下移动,但高度保持100% 现在如果我给出位置:绝对;底部:0对于按钮容器,它会粘贴到modalbox的底部。但是当我向下推模式时,按钮容器也会被向下推 我如何实现将其始终定位在屏幕底部,而不考虑modal的移动 const ButtonContainer = styled(View)` align-items: center; justify-co
位置:绝对;底部:0
对于按钮容器,它会粘贴到modalbox的底部。但是当我向下推模式时,按钮容器也会被向下推
我如何实现将其始终定位在屏幕底部,而不考虑modal的移动
const ButtonContainer = styled(View)`
align-items: center;
justify-content: flex-end;
flex-direction: row;
position: absolute;
bottom: 0;
right: 0;
left: 0;
`
const Container = styled(View)`
padding-left: 15;
padding-bottom: 60;
padding-right: 15;
padding-top: 15;
height: 100%;
`
<Container>
<ScrollView>
{content}
</ScrollView>
<ButtonContainer>{buttons}</ButtonContainer>
</Container>
const ButtonContainer=styled(视图)`
对齐项目:居中;
证明内容:柔性端;
弯曲方向:行;
位置:绝对位置;
底部:0;
右:0;
左:0;
`
const Container=styled(视图)`
左:15;
垫底:60;
右:15;
顶部填充:15;
身高:100%;
`
{content}
{按钮}
提供比您所做的更多的代码。@mayurespatil,为样式添加了更多的代码。try:-删除高度并尝试容器的属性flex:1,或者将高度作为设备维度高度。@mayurespatil这不起作用:(@Johan Correct,这是一个底部有按钮的捕捉模式。因此,即使模式的高度发生变化,我希望按钮保持在屏幕的底部(而不是模式的底部)。