tmxiong / better-banner Goto Github PK
View Code? Open in Web Editor NEWreact native 自动轮播图
react native 自动轮播图
下载此插件并运行在android中直接报错
{ "name": "myapp", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "react": "16.9.0", "react-native": "0.61.5", "react-native-better-banner": "^1.1.2" }, "devDependencies": { "@babel/core": "^7.6.2", "@babel/runtime": "^7.6.2", "@react-native-community/eslint-config": "^0.0.5", "babel-jest": "^24.9.0", "eslint": "^6.5.1", "jest": "^24.9.0", "metro-react-native-babel-preset": "^0.56.0", "react-test-renderer": "16.9.0" }, "jest": { "preset": "react-native" } }
运行代码为:
`import React, {Component} from 'react';
import {StyleSheet, View, Text, Image} from 'react-native';
import BetterBanner from 'react-native-better-banner';
export default class Rnswiper extends Component {
render() {
return (
<BetterBanner
bannerImages={[
{
uri:
'http://attachments.gfan.net.cn/forum/attachments2/201402/05/211339r5eizavo2g5efuar.jpg.thumb.jpg',
},
{
uri:
'http://attachments.gfan.net.cn/forum/attachments2/201402/05/211342pkd8axiibj5axizi.jpg.thumb.jpg',
},
{
uri:
'http://attachments.gfan.net.cn/forum/attachments2/201402/05/2113441e4dw5zvv49jkdow.jpg.thumb.jpg',
},
{
uri:
'http://attachments.gfan.net.cn/forum/attachments2/201402/05/2113472s3y3y1w62n2io6y.jpg.thumb.jpg',
},
]}
/>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});
`
我在state中定义在bannerList数组,初始为空,显示没有值,通过网络请求加载不刷新
设置自动翻页 索引 如何计算
两个空页面,其中一个加入banner组件后,多次切换这2页面,几次之后,就崩溃了,毕现。
数据请求后banner 不刷新
测试发现设置了indicatorColor之后,activeIndicatorColor的属性值无效。所以的点的颜色都是indicatorColor
错误信息如下
Unable to symbolicate stack trace: Exception in HostFunction: Malformed calls from JS: field sizes are different.
[[6,3,24,2],[22,5,1,4],[["{"type":"log","level":"error","data":["Invariant Violation: [237,\"RCTView\",{\"left\":\"<>\"}] is not usable as a native method argument"]}",1],[{"extraData":{"suppressRedBox":true,"rawStack":"invariant@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:1846:26\nenqueueNativeCall@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2666:20\nnonPromiseMethodWrapper@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2270:42\nsetNativeProps@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:11380:61\nsetActiveIndicatorX@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:132076:44\nonScroll@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:132120:33\nonScroll@[native code]\nscrollResponderHandleScroll@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:64031:49\nscrollResponderHandleScroll@[native code]\n_handleScroll@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:63315:59\ninvokeGuardedCallbackImpl@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:9186:21\ninvokeGuardedCallback@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:9280:42\ninvokeGuardedCallbackAndCatchFirstError@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:9284:36\nexecuteDispatch@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:9356:48\nexecuteDispatchesInOrder@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:9376:26\nexecuteDispatchesAndRelease@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:10451:35\nforEachAccumulated@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:9520:18\nrunEventsInBatch@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:10475:27\nrunExtractedPluginEventsInBatch@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:10554:25\nhttp://localhost:8081/index.bundle?platform=android&dev=true&minify=false:10530:42\nbatchedUpdates$1@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:21179:20\nbatchedUpdates@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:10437:36\n_receiveRootNodeIDEvent@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:10529:23\nreceiveEvent@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:10558:32\n__callFunction@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2765:36\nhttp://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2497:31\n__guard@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2719:15\ncallFunctionReturnFlushedQueue@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2496:21\ncallFunctionReturnFlushedQueue@[native code]"},"isFatal":true,"stack":[{"column":25,"lineNumber":1846,"arguments":[],"methodName":"invariant","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":19,"lineNumber":2666,"arguments":[],"methodName":"enqueueNativeCall","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":41,"lineNumber":2270,"arguments":[],"methodName":"nonPromiseMethodWrapper","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":60,"lineNumber":11380,"arguments":[],"methodName":"setNativeProps","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":43,"lineNumber":132076,"arguments":[],"methodName":"setActiveIndicatorX","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":32,"lineNumber":132120,"arguments":[],"methodName":"onScroll","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":null,"lineNumber":null,"arguments":[],"methodName":"onScroll","file":"[native code]"},{"column":48,"lineNumber":64031,"arguments":[],"methodName":"scrollResponderHandleScroll","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":null,"lineNumber":null,"arguments":[],"methodName":"scrollResponderHandleScroll","file":"[native code]"},{"column":58,"lineNumber":63315,"arguments":[],"methodName":"_handleScroll","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":20,"lineNumber":9186,"arguments":[],"methodName":"invokeGuardedCallbackImpl","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":41,"lineNumber":9280,"arguments":[],"methodName":"invokeGuardedCallback","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":35,"lineNumber":9284,"arguments":[],"methodName":"invokeGuardedCallbackAndCatchFirstError","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":47,"lineNumber":9356,"arguments":[],"methodName":"executeDispatch","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":25,"lineNumber":9376,"arguments":[],"methodName":"executeDispatchesInOrder","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":34,"lineNumber":10451,"arguments":[],"methodName":"executeDispatchesAndRelease","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":17,"lineNumber":9520,"arguments":[],"methodName":"forEachAccumulated","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":26,"lineNumber":10475,"arguments":[],"methodName":"runEventsInBatch","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":24,"lineNumber":10554,"arguments":[],"methodName":"runExtractedPluginEventsInBatch","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":41,"lineNumber":10530,"arguments":[],"methodName":"","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":19,"lineNumber":21179,"arguments":[],"methodName":"batchedUpdates$1","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":35,"lineNumber":10437,"arguments":[],"methodName":"batchedUpdates","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":22,"lineNumber":10529,"arguments":[],"methodName":"_receiveRootNodeIDEvent","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":31,"lineNumber":10558,"arguments":[],"methodName":"receiveEvent","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":35,"lineNumber":2765,"arguments":[],"methodName":"__callFunction","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":30,"lineNumber":2497,"arguments":[],"methodName":"","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":14,"lineNumber":2719,"arguments":[],"methodName":"__guard","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":20,"lineNumber":2496,"arguments":[],"methodName":"callFunctionReturnFlushedQueue","file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false"},{"column":null,"lineNumber":null,"arguments":[],"methodName":"callFunctionReturnFlushedQueue","file":"[native code]"}],"componentStack":null,"id":3,"originalMessage":"[237,"RCTView",{"left":"<>"}] is not usable as a native method argument","name":"Invariant Violation","message":"Invariant Violation: [237,"RCTView",{"left":"<>"}] is not usable as a native method argument"}],["POST","http://localhost:8081/symbolicate",8,[["content-type","text/plain;charset=UTF-8"]],{"trackingName":"unknown","string":"{"stack":[{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"invariant","arguments":[],"lineNumber":1846,"column":25},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"enqueueNativeCall","arguments":[],"lineNumber":2666,"column":19},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"nonPromiseMethodWrapper","arguments":[],"lineNumber":2270,"column":41},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"setNativeProps","arguments":[],"lineNumber":11380,"column":60},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"setActiveIndicatorX","arguments":[],"lineNumber":132076,"column":43},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"onScroll","arguments":[],"lineNumber":132120,"column":32},{"file":"[native code]","methodName":"onScroll","arguments":[],"lineNumber":null,"column":null},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"scrollResponderHandleScroll","arguments":[],"lineNumber":64031,"column":48},{"file":"[native code]","methodName":"scrollResponderHandleScroll","arguments":[],"lineNumber":null,"column":null},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"_handleScroll","arguments":[],"lineNumber":63315,"column":58},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"invokeGuardedCallbackImpl","arguments":[],"lineNumber":9186,"column":20},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"invokeGuardedCallback","arguments":[],"lineNumber":9280,"column":41},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"invokeGuardedCallbackAndCatchFirstError","arguments":[],"lineNumber":9284,"column":35},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"executeDispatch","arguments":[],"lineNumber":9356,"column":47},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"executeDispatchesInOrder","arguments":[],"lineNumber":9376,"column":25},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"executeDispatchesAndRelease","arguments":[],"lineNumber":10451,"column":34},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"forEachAccumulated","arguments":[],"lineNumber":9520,"column":17},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"runEventsInBatch","arguments":[],"lineNumber":10475,"column":26},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"runExtractedPluginEventsInBatch","arguments":[],"lineNumber":10554,"column":24},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"","arguments":[],"lineNumber":10530,"column":41},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"batchedUpdates$1","arguments":[],"lineNumber":21179,"column":19},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"batchedUpdates","arguments":[],"lineNumber":10437,"column":35},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"_receiveRootNodeIDEvent","arguments":[],"lineNumber":10529,"column":22},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"receiveEvent","arguments":[],"lineNumber":10558,"column":31},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"__callFunction","arguments":[],"lineNumber":2765,"column":35},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"","arguments":[],"lineNumber":2497,"column":30},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"__guard","arguments":[],"lineNumber":2719,"column":14},{"file":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false","methodName":"callFunctionReturnFlushedQueue","arguments":[],"lineNumber":2496,"column":20},{"file":"[native code]","methodName":"callFunctionReturnFlushedQueue","arguments":[],"lineNumber":null,"column":null}]}"},"blob",false,0,true]],17259]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.