我有一个从 API 呈现动态卡片的视图
<View>
<Card>1</Card>
<Card>2</Card>
<Card>3</Card>
</View>
Run Code Online (Sandbox Code Playgroud)
有没有办法对这个视图进行下拉刷新?
在没有 FlatList 组件的情况下调用服务器并刷新此视图?
我有一个像这样的React Navigation Tab组件:
const RootNavigator=TabNavigator({
Home:{
screen: Home
,navigationOptions:{
tabBarIcon: ({focused}) => (
<Icon
name={focused?'ios-home':'ios-home-outline'}
style={{color:'#464646'}}
size={16}
/>
)
}
},
Notifications:{
screen: Notifications
,navigationOptions:{
tabBarIcon: ({focused}) => (
<TabNotifications focused={focused} />
)
}
},{});
Run Code Online (Sandbox Code Playgroud)
有没有办法在离开屏幕时进行回调?
在这种情况下,我想在离开通知选项卡时执行一项功能.例如将通知标记为已显示并删除徽章指示符.
截至目前,我正在从其他组件中提取通知图标以显示数字徽章.
提前致谢.