是否可以允许某个项目溢出 FlatList 组件的容器?在此示例中,FlatList 中的项目是常规 View 组件,其中有一个“弹出窗口”View 组件,我希望将其显示在 FlatList 容器的边界上。
这就是我想要实现的目标(红色框(绝对定位)溢出了 FlatList 组件的边界)
我的代码
const Item = () => {
return (
<View // this view should be clipped and go inside the container
style={{
height: 55,
width: 55,
backgroundColor: 'lightblue',
margin: 5,
}}>
<View // this view should display over FlatList boundaries
style={{
height: 30,
width: 30,
backgroundColor: 'red',
position: 'absolute',
left: -15,
top: -15,
zIndex: 40,
}}
/>
</View>
);
};
const App = () => …Run Code Online (Sandbox Code Playgroud)