javascript - 如何在 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>
)
}
解决方案
推荐阅读
- swift - 在 Swift Storyboard 中设置自动布局时,为什么会出现 NSInternalInconsistencyException?
- python - MetPy suface_based_cape_cin 返回带有单位的错误
- javascript - 格式化要在 Vue.js 组件中使用的 laravel 路由字符串
- javascript - 如何在javascript子类中调用父方法
- javascript - 排毒匹配器在本地工作,但在 Circle CI 上失败
- c# - C# 在一行中将多个元素添加到 IList - AddRange 不可用
- reactjs - 未找到模块:您尝试导入项目 src/ 目录之外的模块
- php - 使用递归函数从多维数组中返回随机值的字符串值
- typescript - TypeScript 泛型声明语法
- python - 如果两个类扩展不同的类,如何避免重复代码