wuyunqiang / ReactNativeUtil

30 stars 6 forks source link

react-native-elements/SwipeDeck android bug #17

Open wuyunqiang opened 6 years ago

wuyunqiang commented 6 years ago

安装react-native-elements库文件 详见: https://github.com/react-native-training/react-native-elements/blob/master/default_installation.md SwipeDeck ios 运行结果: normal.gif Android 运行结果: wrong.gif 修改代码: SwipeDeck/renderCards如下: fix.png 结果: androidnormal.gif

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

Manoj002 commented 6 years ago

hey guys,

Stucked at same point, is there any update on same.?

wuyunqiang commented 6 years ago

SwipeDeck/renderCards change code to

<Animated.View key={item.id} style={[styles.cardStyle, {zIndex: 0}]}>
      {this.props.renderCard(item)}
</Animated.View>

will be OK.