我想要一个可压预置的背景颜色是蓝色或绿色的基础上的值在防火基础上,即如果它是真实的在火基,可压的颜色是绿色,否则它是蓝色的。
另外,如果我按下按钮,它就会切换火基中的值和按钮交换的颜色。
在我的代码中,当我单击可按压时,颜色会改变,值也会在firebase中被交换,但是当我加载应用程序时,它没有预先设置的颜色。
如果firebase中的值为真,则该按钮在加载时应具有颜色为绿色。
这是我的密码。
import {StatusBar} from 'expo-status-bar';
import React, {Component} from 'react';
im
我有一个文件,里面有我所有的通用样式(styles.js),比如原色、二次颜色、灰色的阴影等等。
当用户登录时,我的主颜色和第二颜色处于redux状态。
我想要的是:当这个道具在我的还原状态更新时,我需要让我的styles.js听到这个变化,并更新所有引用这个主颜色和次颜色的地方。
我做过这件事但不起作用。styles.js似乎从未更新过。
我的styles.js:
import store from 'store';
//here I check if my primaryColor is undifined, if it is, I set the default col
我正在尝试在react native中播放音频。我试图安装react-native-sound,但它没有安装。我已经安装库react-native-sound-player。但是当我按下play按钮时,它显示这个错误:TypeError: null is not an object (evaluating 'RNSoundPlayer.playSoundFile')。下面是我的代码: import SoundPlayer from 'react-native-sound-player';
class myclass extends component {
我在我的应用程序中使用了ViewPager和react-native-step-indicator,但我需要在使用特定按钮时更改页面。
下面是我的代码的一部分:
import ViewPager from 'react-native-viewpager';
import StepIndicator from 'react-native-step-indicator';
const PAGES = ['Business','Logo','Description'];
export default class Us
我正在尝试连接到我的React Native应用程序上的HM-10 BLE模块。我正在使用this example,但在连接Notification error Could not find service with UUID 13333333-3333-3333-3333-333333333337 on peripheral with UUID XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX时收到通知错误(用X的屏蔽了我的UUID ) 我不知道如何查找设备的服务UUID。我打开一个BLE扫描器应用程序,看到服务UUID的FFE0,但不确定它是什么。 我使用的代码是
我正在尝试使用Expo创建我的第一个React Native应用程序,并且我试图在点击一个按钮时console.log一个随机的文本。 当按钮被按下时,我得到两个错误(这是通过Android Studio): 1- NativeAnimatedModule.startOperationBatch is not a function 2- There was a problem sending log messages to your development environment TypeError: stackString.split is not a function. 有时我也会遇到这