React-native-swiper: Android平台不显示

Created on 1 Jun 2017  ·  9Comments  ·  Source: leecade/react-native-swiper

react-navigation的TabNavigator中嵌套Swiper在Android平台上无法正常显示

Most helpful comment

等渲染出来之后再加个setTimeout(),让它重新加载一下就好了

All 9 comments

我也碰到了这个问题,请问你解决没有,我的就是在TabNavigator的第一页上不显示,其他页能显示

+1

+1

等渲染出来之后再加个setTimeout(),让它重新加载一下就好了

389楼

@shabilujie works for me, thanks

加了定时器好了,然后放在FlatList的头部又不显示了,

@shabilujie 具体怎么写呢

666 可以显示了,
@xiong1234777 state 加个属性 比如:

constructor(props) {
       super(props)
       this.state={
             showSlider:false
       }
}

,然后

componentDidMount(){
        setTimeout(()=>{
            this.setState({
                showSlider:true
            })
            //为了解决安卓轮播图无法显示的bug
        },100)

    }

render 里根据 showSlide 的值 判断要不要显示 Swiper

Was this page helpful?
0 / 5 - 0 ratings

Related issues

itinance picture itinance  ·  3Comments

kylehagler picture kylehagler  ·  3Comments

kliuj picture kliuj  ·  3Comments

chetanparakh picture chetanparakh  ·  3Comments

ghost picture ghost  ·  3Comments