小编cg1*_*991的帖子

Xamarin无法创建意图

我按照Xamarin教程打开了另一个活动,但收到一条错误消息:找不到类型或名称空间名称“ Intent”(是否缺少using指令或程序集引用?) 在此处输入图像描述

我可以知道我的代码中是否有任何缺失或错误?谢谢

android android-intent xamarin

4
推荐指数
1
解决办法
970
查看次数

React Navigation Reset可以添加参数吗?

我仍然是新的反应导航.我想在登录成功后重置路由信息.但是有一些参数,比如我希望传递给主页面的登录信息.

import { NavigationActions } from 'react-navigation'

const resetAction = NavigationActions.reset({
  index: 0,
  actions: [
        NavigationActions.navigate({ routeName: 'Profile',
                params:{user:this.state.username}})
      ]
  })
    this.props.navigation.dispatch(resetAction)
Run Code Online (Sandbox Code Playgroud)

在Profile页面中,我想访问params,所以我使用它:

constructor(props){
super(props)
this.state = { username: this.props.navigation.state.params.user, 
  }
Run Code Online (Sandbox Code Playgroud)

但我收到:undefined不是控制台日志中的对象(评估'_this.props.navigation.state.params.user').我可以知道如何获取参数?谢谢

react-native react-navigation

4
推荐指数
4
解决办法
3051
查看次数