leecade / leecade/react-native-swiper

react-navigation 和 react-native-swiper 冲突

Open
#484 13 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Need answer from author
Dominant language
JavaScript
Stars
10.5k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

在demo中使用了 react-navigation 作为分屏组件,在Home屏中使用了 react-native-swiper,所有配置项正确有效的情况下,autoplay = true 时,出现了底部圆点标识在切换但是页面不切换。

const Tab = TabNavigator( { Home: { screen: HomeScene, navigationOptions: ({ navigation }) => ({ tabBarLabel: '首页', tabBarIcon: ({ focused, tintColor }) => ( <TabBarItem tintColor={tintColor} focused={focused} normalImage={require('./assets/img/tabbar_home.png')} selectedImage={require('./assets/img/tabbar_home_selected.png')} /> ) }) }) export default class Root extends React.Component { render() { return ( <HomeScene/> ) } }

在 HomeScene组件中使用了 react-native-swiper
let renderSwipeView = () => { return ( sliderImgs.map((item, i) => { return ( <View style={[{width: w, height: h}, styles.SwiperItem]}> <Image key={i} source={{uri: item}} style={{width: utils.os().width,height: utils.scaleSize(380)}}/> </View> ) } ) } <Swiper height={utils.scaleSize(380)} autoplay={true} loop={false}> {renderSwipeView()} </Swiper>

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in the demo using the Root component with react-navigation and the HomeScene component containing the Swiper. Start by isolating the interaction between tab navigation and Swiper autoplay with the shown settings, then verify that the page changes along with the indicator and that the behavior remains correct when navigation is present.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.