使用react-navigation v5进行唤醒。根据文档示例制作了自定义标签栏。我在底部标签栏内放置了广告横幅。现在,我想在购买活动后删除广告横幅。但是我不确定该怎么做。购买活动结束后如何立即删除我的横幅?
这是我的自定义标签条形码:
我真的没有完全阅读您的代码,所以我不知道哪一部分是广告部分。但是您可以使用conditional rendering
决定何时渲染广告组件。像这样的东西:
render(){
return(
<View>
{this.state.ads &&
<Text style={{ color: 'red' }}>ads here</Text>
}
</View>
);
}