我开始学习反应-土生土长的,很棒的东西。我已经能够使用StackNavigator在屏幕之间导航。
在一个屏幕上,我显示一个从静态json文件中填充的列表。在单击一行时,下一个屏幕应该弹出所选项目的详细信息。任何帮助都将不胜感激。我创建了一个包含所有相关类( )的gist
也将粘贴在这里:
/** index.android.js**/
//This code includes the stack navigation to different screens
import React, { Component } from 'react';
import {
我有一个组件,它从api中获取数据,然后在屏幕上显示数据。我想知道的是,如何延迟在屏幕上显示文本直到api调用完成?
例如:
Your Balance is ____
网络呼叫解决后
Your Balance is 500
但是,"Your Balance is"会在组件呈现后立即显示。
import React, { Component, PropTypes } from 'react'
import {StyleSheet, View, Text} from 'react-native'
export default class Main
我见过很多人都有这个问题,但没有人的答案为我解决了这个错误。我得到的错误是:
undefined is not an object react native evaluating this.props.navigation Here is a picture https://imgur.com/a/JP9RLZT
我的目标是创建一个登录屏幕,该屏幕指向一个带有选项卡栏的主屏幕。工具栏可以工作,但由于上面的错误,我不知道如何使登录屏幕打开到该屏幕。
我的适用文件代码如下所示:
app.js
import React from 'react';
import { StyleSh
为什么我仍然收到以下信息:
"The navigation prop is missing for this navigator. In react-navigation 3 you must set up your app container directly."
这是我的代码
const DrawerNavigator = createDrawerNavigator(
{
Home: {
screen: HomeScreen,
},
About: {
screen: Header2,
},
},
Dra
我在StackNavigator中声明了两个屏幕A和B。StackNavigator嵌套在tabNavigator中。该条在两个屏幕上都可见。我只想在屏幕A中显示它。我在屏幕B中将tabBarVisible设置为false,但没有效果。
import React,{Component} from 'react';
import {Text} from 'react-native';
import {StackNavigator, TabNavigator} from 'react-navigation';
class ScreenA
我试图制作一个简单的动画,在那里我的形象会褪色。
下面的代码我正在导入{useSpring, animated} from 'react-spring'。我创建了简单的useSpring函数logoLoadingScreen。然后,我在图像样式设计中添加了函数,但是没有显示任何动画。
import React from 'react';
import {useSpring, animated} from 'react-spring'
import {View,Text,StyleSheet,Image} from 'react-nativ
我需要检查我的条件反应挂钩时,启动或更改的值我尝试了这段代码,但我不能运行没有Btn
import React,{useEffect} from 'react';
import { StyleSheet, View } from 'react-native';
import * as Permissions from 'expo-permissions';
import { Notifications} from 'expo';
export default function NotificationsTest() {
con
我正在学习如何使用React导航。 如何在Drawer.Screen主页和通知前放置图标 import * as React from 'react';
import { Button, View } from 'react-native';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { NavigationContainer } from '@react-navigation/native';
function Hom
我使用命令“react原生运行-android”运行这个应用程序,它起了作用。但是在使用用户登录信息登录应用程序之后,它会显示黑色的错误屏幕,下面是错误消息。
ERROR TypeError: undefined is not a function
This error is located at:
in Drawer (created by DrawerView)
in DrawerView (created by Navigator)
in Navigator (created by SceneView)
in SceneView (created
我正在使用react-native地图集群的MapView和react-native- map的标记和标注。我无法使用animateToRegion。它向我显示this.mapView.animateToRegion is not a function
<MapView
ref={map=>{mapView = map}}
provider='google'
clustering={true}
onClusterPress={this.onPressCluster}
region={this.state.region}
onRegionChange={
我已经创建了一个React-Native应用程序,并想要设置导航。我用NavigationContainer创建了我的文件,我认为我已经做了正确的事情,但我在更改屏幕时遇到了问题。我在Expo或bundler中没有实际错误,但是请求的屏幕没有显示出来,尽管标题发生了变化。所以我觉得我在代码中遗漏了一些东西。我知道我犯了个错误,但我需要你帮我弄清楚并改正...感谢您的时间和帮助。
导航:
import React from 'react'
import { Image } from 'react-native'
import { creat