目标-我想创建一个带有 3 个导航(2 种类型)的应用程序
反应导航": "^3.3.2
Authloading- 基本上是一个加载页面,用于检查异步存储中的令牌并决定是否重定向到AuthStack或AppStack。
AuthStack - 它有登录和注册页面。AppStack - 包含一些在登录后打开的页面,例如仪表板、配置文件等。到目前为止我取得的成就 -
我可以执行登录、注销、检查应用加载时用户是否已经登录。
剩下的 - 当用户进入主页/仪表板时,我希望有一个侧菜单/抽屉可以在滑动和按下按钮时打开。
我已经尝试过 React navigation 3 文档,但我认为我太新了,无法理解,Index.js-
import React from 'react';
import { createStackNavigator, createSwitchNavigator, createAppContainer,
createDrawerNavigator } from 'react-navigation';
import Signup from './Screens/Authentication/SignUp';
import SignInScreen from './Screens/Authentication/Login';
import HomeScreen from './Screens/DashBoard/Home';
import AuthLoadingScreen from './Screens/Authentication/AuthLoadingScreen';
const AppStack = createStackNavigator({
Home: HomeScreen,
// Other: OtherScreen
});
const AuthStack = createStackNavigator({
SignIn: SignInScreen,
SignUp: Signup
}, { …Run Code Online (Sandbox Code Playgroud) 我使用 react-native-video 和 react-native-video-player 库。我的问题是下一个 - 如何卸载视频?我有一个视频列表(我要求拍摄所有视频,但一开始只显示 5 个,然后我按下“显示更多”按钮并加载 5 个以上的视频,但是如果我播放了 8 个以上的视频(播放和暂停)其他视频停止工作 - 我按下视频的播放控制,视频变成白色)。我可以通过按“显示更多”来卸载以前的视频,还是有另一种方法可以避免此类问题?谢谢。
reactjs react-native react-native-android react-native-video
如何使用 React Native 中的 react-navigation 在 Android 中使用向下滚动操作自动隐藏标题并使用向上滚动操作显示标题?
const HomeStack = createStackNavigator({
Home: {
screen: HomeIndexScreen,
},
Details: {
screen: HomeItemScreen,
}
},{
headerLayoutPreset : 'center',
headerMode: 'float'
});
Run Code Online (Sandbox Code Playgroud) 当我们滚动 sectionList 时,我们可以将粘性标题粘贴在滚动视图的顶部。
但我需要的是在粘性标题和滚动视图顶部之间设置边距,即在滚动视图顶部之间留出空隙。
有谁知道如何处理?
我一直在研究本机反应的应用程序 - 并且还在谷歌上构建了一个应用程序。
我想要做的是允许用户调用命令 - 从我的本机 android 应用程序 - 使用谷歌助手。
例如:“好吧,谷歌,使用 jons 应用程序做笔记”
然后它会打开原生 android 应用程序——它会调用一个方法来说出“你的笔记是什么:”,然后它会开始语音识别——当关闭时,把它传递给 dialogflow。
这背后的前提是允许某人使用我的语音助手而无需直接将其集成到他们的设备上。也许这是一个有缺陷的想法,或者它不受支持。
我找到了一个注册:https : //developer.android.com/guide/actions/
我很惊讶的是还没有。
我的问题很简单 - 我可以使用来自谷歌助手的本机应用程序调用显式方法吗?
我已经使用react-native init ProjectName创建了项目。这个项目是用 java-8 版本创建的,但现在我已经改变了我的系统,因为不再支持在系统中安装 java-11 的 java-8,所以我必须在我现有的项目中使用 java-11。
当我在使用命令npm-start & react-native run-android启动 npm 后运行代码时,我遇到的问题是 -
FAILURE:构建失败,出现异常。
什么地方出了错:
无法从“11.0.2”确定 java 版本。
我曾尝试更改 android 配置,如 gradle 版本和其他版本,但仍然没有运气。
我也在网上搜索过,但没有得到满意的答案,大部分答案是说卸载java-11并安装java-8。
我还浏览了 react native 的官方网站,但仍然没有运气。 https://github.com/facebook/react-native/issues/22487
操作系统 - Ubuntu 18.0.4 Java vrsion install -11.0.2 react-native-cli: 2.0.1 react-native: 0.56.0 node - v10.15.3 npm - 6.4.1
“依赖关系”:{
"lodash": "^4.17.11",
"react": "16.4.1",
"react-native": "0.56.0",
"react-native-elements": "^0.19.1",
"react-native-iphone-x-helper": "^1.2.0",
"react-native-navigation": "^2.3.0",
"react-native-segmented-control-tab": "^3.3.1",
"react-native-tabbar-bottom": "^1.0.4",
"react-native-vector-icons": "^6.1.0",
"react-redux": "^6.0.0",
"prop-types": "^15.6.2",
"redux": "^4.0.1"
Run Code Online (Sandbox Code Playgroud)
}, …
我试图了解这件事是如何工作的,但我发现的所有示例都是以课堂方式编写的。
import React from 'react'
import styled from 'styled-components/native'
const MyTag = styled.Button.attrs({
title: myThisThingValue
})`
// some style
background: thisIsAlsoMyThingValue
\`
export default function MyComponent({ props }) {
return(
<MyTag myThisThing="My value" thisIsAlsoMyThing="Other Value" />
)
}
Run Code Online (Sandbox Code Playgroud)
我只想访问 MyTag 样式中的自定义属性。我(props) => {title: props.MyThing }在 .attrs() 中使用了 a但没有用。
javascript reactjs react-native react-native-android styled-components
我正在制作简单的本机应用程序。我尝试将我的应用程序上传到 Google Play 商店,但失败了。我遵循了这个文档。正如它所说,我./gradlew buildRelease在终端上打字。结果如下。
> Configure project :react-native-voice
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (23.0.2) is ignored, …Run Code Online (Sandbox Code Playgroud) 我compileSDkversion从27更新到28。
在gradle.properties文件中添加:
android.useAndroidX=true
android.enableJetifier=true
Run Code Online (Sandbox Code Playgroud)
在build gradle补充:
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core:1.0.2'
Run Code Online (Sandbox Code Playgroud)
在 build.gradle 中将支持库重构为 androidX 库。
我收到构建错误:
找不到 androidx.appcompat:appcompat:28.0.0
问题是什么?我还应该改变什么?
PS:这是 expoKit react-native 项目
I have a React Native app in which at some page I've got a web view (react-native-webview) for displaying PDFs from our server.
In iOS everything works fine, in Android, whenever I try to view the file I got:
Cannot downoad files as permission was denined. Please provide permission to write to storage, in order to download files.
I've then added <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> to my manifest. Now, I'm getting the following alert:
I think it's pretty scary …
android android-permissions react-native react-native-android react-native-webview