美文网首页react-native
react-native-scrollable-tab-view

react-native-scrollable-tab-view

作者: 以德扶人 | 来源:发表于2018-12-17 15:13 被阅读148次

react-native-scrollable-tab-view 安卓偶尔会出现内容框不显示,只显示tabbar的bug.
目前我的解决方法是:
1.第一种方法:外层加一个view,给view宽高.
这种方法有时候是没效果的.

2.第二种方法:
constructor(props) {
super(props);
this.state = {
delayShow:false
}
}

componentDidMount() {
//增加一个延时
this.timer = setTimeout(() => {
this.setState({
delayShow: true
})
})
}

render() {
return (
{ //进行判断
this.state.delayShow && (<ScrollableTabView> ...</ScrollableTabView>)
}
)
}

正常情况第二种方法是可以解决的.

相关文章

网友评论

    本文标题:react-native-scrollable-tab-view

    本文链接:https://www.haomeiwen.com/subject/nofckqtx.html