当我使用这个例子在我的应用程序上实现 Image-slider 时,我遇到了这个错误。
import React,{Component} from 'react'
import {View,Text,TouchableOpacity, ViewPagerAndroid} from 'react-native'
import Infoslider from 'react-native-infoslider'
export default class example extends Component {
constructor(props) {
super(props);
this.state = {
data:[
{
title:"Hello World",
text:"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard",
image: require('../Images/Group.png')}
]
};
}
render() {
return (
<Infoslider
data={this.state.data} />
);
}
}
Run Code Online (Sandbox Code Playgroud)
小智 8
您应该将react-native-swiper模块更新为nightly。然后,npm 清除缓存。
请遵循以下步骤:
- 安卓系统
- ./gradlew 干净
- 光盘 ..
- 纱线移除反应本机刷卡器
- 纱线添加react-native-swiper@nightly
- rm -rf 节点模块
- npm 缓存清理 --force
- npm 安装
- 反应本机运行 Android
它会起作用的。但如果没有,请重新启动系统。
| 归档时间: |
|
| 查看次数: |
6028 次 |
| 最近记录: |