我是反应原生的新手.我在https://facebook.github.io/react-native/docs/sample-application-movies.html中看到了一个例子.它正在构建一个电影应用程序,可以获取电影并在ListView中显示它们.我们如何选择一行来获取其详细数据并在其他视图中显示?请帮忙.谢谢 :)
这是我到目前为止所做的:
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
import React, {
Component,
} from 'react';
import {
AppRegistry,
Image,
ListView,
StyleSheet,
Text,
View,
Navigator,
TouchableOpacity,
} from 'react-native';
var REQUEST_URL = 'https://raw.githubusercontent.com/facebook/react-native/master/docs/MoviesExample.json';
var SCREEN_WIDTH = require('Dimensions').get('window').width;
var BaseConfig = Navigator.SceneConfigs.FloatFromRight;
var CustomLeftToRightGesture = Object.assign({}, BaseConfig.gestures.pop, {
snapVelocity: 8,
edgeHitWidth: SCREEN_WIDTH,
});
var CustomSceneConfig = Object.assign({}, BaseConfig, {
springTension: 100,
springFriction: 1,
gestures: {
pop: CustomLeftToRightGesture,
}
});
var PageOne = React.createClass({
getInitialState:function(){
return{
dataSource: …Run Code Online (Sandbox Code Playgroud)react-native react-native-listview react-native-android react-native-ios
有没有像moveTaskToBackReact Native 那样有能力的图书馆?
以前我用https://github.com/jaysoo/react-native-activity-android,它有moveTaskToBack.但不幸的是,这个repo不再活跃了,而且自从React Native 0.29以来,它有一些内部更改,使得该库无效.
我的Android应用程序包含两个屏幕:“登录”和“仪表板”。登录工作正常,但仪表板是麻烦者。
在登录屏幕上,我可以打开调试菜单,一切正常。当我切换到仪表板屏幕时,我无法再打开菜单。如果我在“登录”屏幕中启用了检查器,然后转到“仪表板”屏幕,则检查器会消失。
当我在没有附加调试器的情况下运行该应用程序时,仪表板中没有任何数据,但登录照常进行。
当我连接调试器时,应用程序会“卡住”很多。通过在屏幕“卡住”时单击屏幕(带有连接的调试器),App向前移动了一步-当我足够频繁地单击屏幕时,我得到的是我期望的所有数据!没有设置断点,我根本不需要使用调试器,只需附加它。
iOS对应程序似乎工作正常。
这有什么问题吗?
我正在使用React-Native 0.31.0
只是要澄清一下:我的问题不是调试器本身。我的问题是这样的事实:在附加调试器时,没有调试器就不会获得任何数据,但是会获得所有数据(仅适用于Android!)。
debugging google-chrome-devtools react-native react-native-android
我正在研究示例应用程序。我已经基于View Container设计了我的应用程序。通过使用以下情况,我以手机(iOS / Android)的肖像模式设计了我的应用程序,还为iPad /平板电脑设计了肖像模式和LandScape模式。
在Android中,我遵循了这种情况
在iOS中,我遵循这种情况
Xcode -> general -> Development info -> Device Orientation并选择PortraitiPhone和Portrait , LandscapeLeft and LandScapeRightiPad。现在,我想在纵向和横向模式下为iPad和平板电脑设计splitView。我在Google上进行了搜索,但未找到任何信息。我想知道如何在Android和iOS中设计它(拆分视图)。
splitview react-native react-native-android react-native-ios

我想发布这样的表单数据.
我应该准备什么来发送图像文件数据?
我有Uri,类型,文件名,大小.
然后将使用fetch for it.
标题中的内容类型是'multipart/formdata'
谢谢你的帮助
安装React native后,运行以下命令:
$ react-native init demoApp
并得到这个错误:
Error: Cannot find module 'react-transform-hmr/lib/index.js'
at Function.Module._resolveFilename (module.js:325:15)
at Function.require.resolve (internal/module.js:16:19)
at makeMakeHMRConfig7 (/home/local/MPLLC/malwinder.singh/demoApp/node_modules/react-native/node_modules/metro/src/babel-bridge.js:120:31)
at Object.<anonymous> (/home/local/MPLLC/malwinder.singh/demoApp/node_modules/react-native/node_modules/metro/src/babel-bridge.js:49:24)
at Module._compile (module.js:409:26)
at Module._extensions..js (module.js:416:10)
at Object.require.extensions.(anonymous function) [as .js] (/home/local/MPLLC/malwinder.singh/demoApp/node_modules/react-native/node_modules/babel-register/lib/node.js:152:7)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
Run Code Online (Sandbox Code Playgroud)
我错过了什么?如何解决这个问题?
在某些非常特殊的情况下,我需要将View的高度设置为设备有用区域的整个高度(不使用flex)。
我使用了一个硬编码的“缺口高度”来计算此有用的高度,但是我发现缺口取决于设备的高度可能有所不同。(iPhone XS和iPhone XS Max之间有3点差异)。
有没有办法知道带有缺口和安全区域的设备的有用高度?
ios reactjs react-native react-native-android react-native-ios
我想在一页上请求权限,而不是等待每种特定情况。但是,我不希望有多个弹出窗口。有没有一种方法可以通过单个弹出窗口/模式来请求权限。
permissions react-native react-native-android react-native-ios
我尝试运行react-native run-android,但出现此错误。
info Running jetifier to migrate libraries to AndroidX. You can disable
it using "--no-jetifier" flag.
error Failed to run jetifier. Run CLI with --verbose flag for more details.
Error: spawnSync C:\Users\JayK\Desktop\React\AwesomeProject\node_modules\jetifier\bin\jetify ENOENT
at Object.spawnSync (internal/child_process.js:1002:20)
at spawnSync (child_process.js:614:24)
at execFileSync (child_process.js:642:13)
at Object.runAndroid [as func] (C:\Users\JayK\Desktop\React\AwesomeProject\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:101:41)
at Command.handleAction (C:\Users\JayK\Desktop\React\AwesomeProject\node_modules\@react-native-community\cli\build\cliEntry.js:160:21)
at Command.listener (C:\Users\JayK\Desktop\React\AwesomeProject\node_modules\commander\index.js:315:8)
at Command.emit (events.js:198:13)
at Command.parseArgs (C:\Users\JayK\Desktop\React\AwesomeProject\node_modules\commander\index.js:651:12)
at Command.parse (C:\Users\JayK\Desktop\React\AwesomeProject\node_modules\commander\index.js:474:21)
at setupAndRun (C:\Users\JayK\Desktop\React\AwesomeProject\node_modules\@react-native-community\cli\build\cliEntry.js:210:24)
Run Code Online (Sandbox Code Playgroud) 我已经根据以下链接实现了Android应用程序链接。
https://developer.android.com/studio/write/app-link-indexing.html
https://developer.android.com/training/app-links
我已经将assetlinks文件托管到我们的域https://ourdomain/.well-known/assetlinks.json中, 而且我已经使用https://developers.google.com/digital-asset-links/tools/generator 和从android studio的应用链接助手也。并通过两种方式获得了验证状态。
现在,当我生成一个已签名的构建并通过Google驱动器链接对其进行测试时。Android应用程序链接按预期工作(单击链接后,应用程序将打开,而无需打开适用于android 6.0及更高版本的消歧对话框)。
将相同版本上传到Play商店后,它不起作用。
以下是清单文件中使用的代码。
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
android:host="<ourdomain>" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
编辑:Android应用程序链接将其上传到Play商店后,按预期工作了一天。并在第二天重新开始消除歧义对话。知道可能是什么问题吗?
Play商店中的同一版本在不同的日子给了我两个不同的状态,分别是Ask和Always。
adb shell dumpsys程序包domain-preferred-apps
当我运行上面的命令
android android-studio react-native react-native-android android-app-links
react-native ×9
android ×3
reactjs ×2
debugging ×1
fetch ×1
ios ×1
java ×1
kotlin ×1
permissions ×1
splitview ×1