我在尝试使用 100% 高度的 Flex 显示视图列表时遇到问题,当它从平面列表渲染列表时出现问题,我可能会用 Flex 做一些错误的事情。
这就是我想要的:滚动时具有相同高度的平面列表我将转到另一个组件
这就是我所拥有的所有渲染视图的粉碎列表
flatList 就是这样:
<FlatList
pagingEnabled={true}
data={DATA}
renderItem={renderItem}
keyExtractor={(item) => item.id}
/>
Run Code Online (Sandbox Code Playgroud)
我正在渲染的视图中的容器看起来像这样(css)
container: {
alignItems: 'center',
// TODO: check how why the screen is forguetting the tab, thats why I put the height like that
width: '100%',
height: '100%',
justifyContent: 'space-around',
flex: 1,
},
Run Code Online (Sandbox Code Playgroud)