rilyu / teaset

A UI library for react native, provides 20+ pure JS(ES6) components, focusing on content display and action control.
MIT License
2.94k stars 481 forks source link

Carousel startIndex指定了0 却经常出现最后一个的view #159

Open supermanxiacheng opened 6 years ago

supermanxiacheng commented 6 years ago

`<Carousel style={{backgroundColor: '#fff', height:400, borderTopWidth: 1, borderTopColor: '#fff'}} carousel={false} startIndex={0} cycle={true} ref='carousel' onChange={index => this.onCarouselChange(index)}

                <View style={[{backgroundColor:'red',width:50,height:50},]}></View>
                <View style={[{backgroundColor:'blue',width:50,height:50},]}></View>
                <View style={[{backgroundColor:'green',width:50,height:50},]}></View>

            </Carousel>`

有时加载时出现红色view,有时加载时出现绿色viewe

比较紧急,给个临时方法解决也好..

supermanxiacheng commented 6 years ago

this.timer = setTimeout( () => { this.refs.carousel.scrollToPage(0, false); }, 500 ); 暂时这样修复了

Jinran commented 6 years ago

我也遇到了相同的问题,还希望作者大大快点修复呀

rilyu commented 6 years ago

这个问题之前也有人提过,但我一直无法重现,在 example 中也从来没有出现过

supermanxiacheng commented 6 years ago

@rilyu 我们测试发现,安卓手机越烂越容易复现.

footygoodman commented 6 years ago

+1 @rilyu Redmi 5 Plus android 7.1.2 react: 16.3.1 react-native: 0.55.4

      <Carousel
        style={{ flex: 1 }}
        control={true}>
        {this._createImages()}
      </Carousel>

_createImages返回的是 [,,] ,每个Image的图片均从http加载

leozhang007 commented 6 years ago

我也有这个问题, 我的package: "dependencies": { "@remobile/react-native-qrcode-local-image": "^1.0.4", "color": "^3.0.0", "jcore-react-native": "^1.2.6", "jpush-react-native": "^2.2.5", "native-base": "^2.4.5", "prop-types": "^15.6.1", "react": "16.3.1", "react-native": "0.55.3", "react-native-camera": "^1.1.4", "react-native-code-push": "^5.3.2", "react-native-device-info": "^0.21.5", "react-native-extended-stylesheet": "^0.8.1", "react-native-fetch-blob": "^0.10.8", "react-native-fs": "^2.10.14", "react-native-image-picker": "^0.26.7", "react-native-image-progress": "^1.1.1", "react-native-img-cache": "^1.5.3", "react-native-input-scroll-view": "^1.6.7", "react-native-modal": "^6.1.0", "react-native-modalbox": "^1.4.2", "react-native-progress": "^3.4.0", "react-native-qrcode-scanner": "^1.0.1", "react-native-qrcode-svg": "^5.0.7", "react-native-root-toast": "^3.0.1", "react-native-router-flux": "^4.0.0-beta.31", "react-native-scrollable-tab-view": "^0.8.0", "react-native-sf-drawer": "^1.0.2", "react-native-storage": "^0.2.2", "react-native-svg": "^6.4.1", "react-native-swiper": "^1.5.13", "react-redux": "^5.0.7", "redux": "^4.0.0", "redux-form": "^7.3.0", "redux-logger": "^3.0.6", "redux-persist": "^5.9.1", "redux-saga": "^0.16.0", "redux-thunk": "^2.2.0", "rn-viewpager": "^1.2.9", "teaset": "^0.5.6" }, "devDependencies": { "babel-jest": "22.4.3", "babel-plugin-module-resolver": "^3.1.1", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-preset-react-native": "4.0.0", "babel-preset-react-native-stage-0": "^1.0.1", "fs.promised": "^3.0.0", "jest": "22.4.3", "koa": "^2.5.1", "koa-body": "^2.5.0", "koa-compose": "^4.0.0", "koa-route": "^3.2.0", "koa-router": "^7.4.0", "koa-static": "^4.0.2", "react-test-renderer": "16.3.1", "remote-redux-devtools": "^0.5.12", "remote-redux-devtools-on-debugger": "^0.8.3" },

ChenTianSaber commented 6 years ago

我也遇到了,希望尽快修复吧...

elings8 commented 6 years ago

经过测试好像只要 Carousel 设置成 false, Cycle 设置成 true, 就会有这个问题。

tangcaiyue commented 5 years ago

这个问题之前也有人提过,但我一直无法重现,在 example 中也从来没有出现过

我后台接收5张图片展示,安卓第二张图片加载不出来,然后在ios第一次第二张图片加载不出来,第二次轮播才加载出来,不知道什么原因 ,是因为安卓第一次轮播某些图片加载不出来,第二次就不加载了吗,然后ios每次都加载?

ZSH-HSZ commented 5 years ago

这个问题之前也有人提过,但我一直无法重现,在 example 中也从来没有出现过

https://github.com/rilyu/teaset/issues/159#issuecomment-423975190 这样就会重现,希望可以修复一下

qhrosl commented 5 years ago

我也是这个问题

leesyun commented 5 years ago

carousel={false} cycle={false} 我好像设置成这样就好了