首页 > 解决方案 > 如何在 react-native 中分别渲染 2 个幻灯片组件

问题描述

我正在尝试为正在使用 react-native 实现的移动应用程序实现团队选择器组件,该组件将如下所示;

在此处输入图像描述

幻灯片放映是一个开源模板 ( https://github.com/kamalpandey/react-native-image-slider-show )

现在我的问题是,当我从幻灯片更改国家/地区时,团队幻灯片需要在县幻灯片动画继续播放的同时自动呈现。

  render() {
    return (
      <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
        <Text>Select your team!</Text>
        <SlideShow 
        dataSource={[
            { 
              url:'http://placeimg.com/640/480/any'
            },
            { 
              url:'http://placeimg.com/640/480/any' 
            },
            { 
              url:'http://placeimg.com/640/480/any' 
            }
        ]}
        onPositionChanged = {(index)=> console.log("position index", index)}/>
        <SlideShow 
        dataSource={[
            { 
              url:'http://placeimg.com/640/480/any'
            },
            { 
              url:'http://placeimg.com/640/480/any' 
            },
            { 
              url:'http://placeimg.com/640/480/any' 
            }
        ]}
        onPositionChanged = {(index)=> console.log("position index", index)}/>
      </View>
    )
  }

标签: javascriptreact-native

解决方案


推荐阅读