The Header doesn't update when scroll the viewpage in Android
onSelectedIndexChange(index, offset) { // this is not curently used this.state.current.setValue(index); }
when scroll the viewpage, the onSelectedIndexChange is called, but the Header doesn't update the relative City info. It works in IOS.
Hi and thanks :) I haven't had time to test the app properly on an Android device, I plan to do that very soon. I think if you check out the latest version of the repo, you'll see the code has updated a bit, it might work. Animations are now used to display the headers for different locations. Check it out, let me know :)
hmmm....I just update your latest code, it still does not work in Android device, seems the this.setState({current: index}) doesn't trigger re-render. I am new to React native, I will try to do some debug. :-)
Ok thanks, I'll try and get a working Android version sometime next week.
Hey, I found the root cause, it is because the onScroll callback of swiper is not supported in Android, so I add onSelectedIndexChange(index, offset) { this.state.shift.setValue(index * SCREEN_WIDTH);//update the offset only when drag is end this.setState({current: index}); }
and it can update the header now :-)