草庐IT

react-router-domV

全部标签

android - Android中如何绑定(bind)React Native的图片资源?

我用react-nativebundle--entry-file"index.android.js"--platform"android"--bundle-output"./assets/index.android.bundle"--verbose将JScodebundle打包放入assets中,可以但是本map片资源无法显示,本map片资源位于./App/Img/文件夹下,并且用于:consticon1=require('./App/Img/slider.png');我怎样才能bundle这些资源文件,以便我可以生成一个运行的apk。 最佳答案

android - React Native map 加载位置

我正在尝试使用react-native-maps模块制作一个应用程序。我可以通过navigator.geolocation.watchPosition获取设备位置,我还使用内置于showUserLocation属性中的map。我怎样才能实现加载时的map会转到用户位置。看不到整个世界,也看不到硬编码的初始位置。编辑:这是我的react-native-map元素。该区域设置为硬编码初始位置,我想将其更改为始终在用户位置加载。this.setState({initialPosition:region})}onLongPress={this.mapOnPress}showsUserLocat

android - list 合并失败。添加并链接 react-native-device-info 后

list合并失败:来自[com.android.support:cardview-v7:25.3.1]AndroidManifest.xml:24的属性元数据#android.support.VERSION@valuevalue=(26.0.1):9-31也存在于[com.android.support:support-v4:26.1.0]AndroidManifest.xml:28:13-35value=(26.1.0)。建议:在AndroidManifest.xml:26:9-28:38处的元素中添加'tools:replace="android:value"'以进行覆盖。RNv0

android - 在一个 react-native 项目中使用 google map 和 FCM

我想在一个ReactNative项目中使用googlemap和FCM,首先我在项目中添加了FCM,一切正常,但是当我添加googlemap时,我遇到了一个错误:我在谷歌上搜索了很多,有很多我尝试过的答案,但没有一个对我有用,例如:https://github.com/firebase/FirebaseUI-Android/issues/1230,谁来帮帮我。我将提供我的项目的一些屏幕截图,如果您需要其他东西,请告诉我。 最佳答案 Note:I'musingthelatestversionofreact-native(v0.56.0)

javascript - React Native - 如何在返回上一页时刷新 FlatList?

我将尝试解释我的情况:我有2个页面/屏幕SreenA.js:......ScreenB.js:...ThisbuttonforbacktoScreenA...我想要实现的目标:WhenipressbackbuttoninscreenB,myappwillbacktoscreenA.WhenicomebacktoscreenA,ineedtorefreshtheFlatList.(eachtimeibacktoscreenA).我如何在AndroidNative中实现这种情况?Iaddthissectiontohelpyoutomoreunderstandwhatchallengeifa

android - React Native - 在包 'appComponentFactory' 中找不到属性 'android' 的资源标识符

我遇到了一个问题,每当我尝试使用react-nativerun-android进行构建时,构建都会失败并出现以下错误。\?\E:\projects\deets-mobile-cp\android\app\build\intermediates\manifests\full\release\AndroidManifest.xml:88:AAPT:Noresourceidentifierfoundforattribute'appComponentFactory'inpackage'android'FAILURE:Buildfailedwithanexception.Whatwentwron

android - 选择器 react 缓慢 - 有时在开始下一个 Activity 之前根本不触发

我定义了这个选择器:它与这个按钮一起使用:onTouch事件包括:publicbooleanonTouch(Viewv,MotionEventevent){finalintactionPerformed=event.getAction();finalintwidgetID=v.getId();if(actionPerformed==MotionEvent.ACTION_UP){switch(widgetID){caseR.id.filter_button_back:{this.finish();break;}}}returnfalse;}这个按钮的作用是退出当前Activitythis

android - 全文未显示在 react native 的警报对话框中

我试图在用户点击按钮时显示警告对话框。我正在尝试如下onPressButton(){Alert.alert(strings.tour_end);}strings.tour_end是“太棒了!希望您喜欢我们的产品之旅!享受这个应用程序。我们为您准备了一些激动人心的优惠!”这就是它在alert中的显示方式。这是react-native中的错误吗? 最佳答案 您已根据警报API将完整消息作为警报标题传递。alert(title,message?,buttons?,options?,type?)喜欢下面alert("Great..!",st

android - 如何为 React Native 安装 rnpm 包

我正在尝试为我的react-native包安装这个包。https://www.npmjs.com/package/react-native-dialogs我看到我需要执行这个命令来安装它。rnpminstall--savereact-native-dialogs我的机器上安装了node和npm。我不确定rnpm是什么。我收到一个错误。我试图浏览一些链接,但没有成功。'rnpm'isnotrecognizedasaninternalorexternalcommand,operableprogramorbatchfile. 最佳答案 r

android - 错误 : Undefined is not a function - React Native

我创建了一个简单的Activity,如果您在圆形区域内按下,其中的文本应该相应地改变。该应用程序运行良好,但是当我在圆形区域内按下时,我收到一条错误消息,提示“undefinedisnotafunction(evaluating'this.setState({pressing:true});')”。另外,圆形区域内的文本应该是初始设置的,但它是空的。可以看到Activityhere.下面还提供了代码:importReact,{Component}from"react";import{StyleSheet,View,AppRegistry,Text,TouchableHighlight}