Open wuyunqiang opened 6 years ago
hey guys,
Stucked at same point, is there any update on same.?
SwipeDeck/renderCards change code to
<Animated.View key={item.id} style={[styles.cardStyle, {zIndex: 0}]}>
{this.props.renderCard(item)}
</Animated.View>
will be OK.
安装react-native-elements库文件 详见: https://github.com/react-native-training/react-native-elements/blob/master/default_installation.md SwipeDeck ios 运行结果:
Android 运行结果:
修改代码:
SwipeDeck/renderCards如下:
结果:
![androidnormal.gif](http://upload-images.jianshu.io/upload_images/3353755-a8ebb964e3f97ac2.gif?imageMogr2/auto-orient/strip)
zindex:是rn在0.30开始支持的属性。 zIndex controls which components display on top of others. Normally, you don't use zIndex. Components render according to their order in the document tree, so later components draw over earlier ones. zIndex may be useful if you have animations or custom modal interfaces where you don't want this behavior。 zindex属性可以控制组件显示在其他组件上,正常情况,你不需要使用。组件通过组件树,后一个覆盖前一个。zindex可以用于动画或者自定义modal,让你决定谁可以显示在上面。
相关问题: https://github.com/react-native-training/react-native-elements/issues/418 https://github.com/facebook/react-native/issues/8968