我有一些元素,其中所述顶部元件应该重叠的底部元件的FlatList。对于这一点,我想扭转zIndex的,但FlatList不断改写我的zIndex的。
在下面我的代码试图扭转与qazxsw POI的Z指数,但它不工作
zIndex: 0 - index
import React, { Component } from "react";
import { FlatList, Text, View, StyleSheet } from "react-native";
export default class App extends React.Component {
_renderPost({ index }) {
return <View style={[styles.item, { zIndex: 0 - index, }]} />;
}
render() {
return <FlatList data={[1, 2, 3, 4, 5,]} renderItem={this._renderPost} />;
}
}
const styles = StyleSheet.create({
item: {
height: 200,
borderWidth:2,
borderBottomLeftRadius:50,
borderBottomRightRadius:50,
marginBottom: -50,
backgroundColor:"white",
},
});