index.android.js
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
ScrollView,
TextInput,
View ,
} from 'react-native';
var styles = require('./Style/customStyle');
import Button from 'react-native-button';
import RadioButton from 'react-native-radio-button'
class AwesomeProject extends Component {
constructor(props){
super(props)
this.state = {
username: '',
password: '',
}
}
render() {
return (
<ScrollView style={styles.content}>
<View style={styles.content}>
<Text style={styles.welcome}>
Create Account
</Text>
<Text style={styles.textStyle}>
Name
</Text>
<TextInput
style={styles.textInputStyle}
placeholder="Enter Name"
returnKeyLabel = {"next"}
onChangeText={(text) => this.setState({text})}
/>
<Button style={styles.buttonStyle}>
Submit
</Button> …Run Code Online (Sandbox Code Playgroud) 令人惊讶的是,在Stack Overflow上没有一个问题可以将这些组合在一起.关于斜体或强调的SO没有答案,事实上,只有这个问题是大胆的.我在下面自我回答了这个问题.
react-native react-native-text react-native-android react-native-ios
我是React Native的新手我想知道如何在服务器上部署反应本机部分或代码(如javascript文件和资源)然后使用它.
目前它显示为localhost
请告诉我如何在服务器上部署它也是可能的.
每当我更改代码中的某些内容时,是否需要更新Play商店中的应用程序?
什么样的代码推送做什么,有什么方法可以从服务器加载我的反应本机包并动态更新应用程序
javascript android react-native react-native-android react-native-code-push
在用于反映代码更改的react-native 0.61之前的版本中,我们有两个选择。
但是在0.61版本中,删除了这两个(Live Reload、Hot Reload),引入了一个名为Fast Refresh的新开发功能,它的工作方式也类似于Hot Reload 所以现在的问题是Fast Refresh和Hot Reload之间的根本区别是什么.
我正在为我们的应用程序进行更新.我添加了一个HeadlessTask,我开始在控制台中看到这个警告:
React: Calling JS function after bridge has been destroyed
如何获取正在执行的函数的名称?
我有一个 textInput 和一个按钮。当 textInput 被聚焦时,键盘会出现,但如果你在键盘可见的情况下点击按钮,首先键盘消失,然后只有你可以点击按钮。为什么?我怎样才能让它工作,以便可以在键盘可见的情况下点击按钮?在 android studio(android native)中开发的应用程序可以获取键盘可见的点击监听器。但是在本机反应中,它不起作用。如果你点击按钮以外的任何地方,那么键盘应该消失,不是吗?但是如果你点击键盘可见的按钮,btn 应该接收监听器。我正在android设备上测试它。
PS你可以在这里试试:https : //snack.expo.io/@codebyte99/addcomponents
<TextInput
placeholder={'Type smth'}
style={[{ borderBottomColor: 'gray', borderBottomWidth: 1 }]}
/>
<TouchableOpacity onPress={() => { this._onPressOut(); }}>
<Text>click here</Text>
</TouchableOpacity>
Run Code Online (Sandbox Code Playgroud) 如果cd android && ./gradlew clean在react-native run-android此失败之前没有运行,则会出现以下错误:
无法创建文件夹:...
要么
删除文件夹失败:...
所以我必须再跑一次才能解决它.
请帮我解决gradlew clean.
非常感谢.
反应导航文档仍然很年轻,阅读问题对我来说并不是很有用(每个版本的更改)是否有人使用react-navigationReact Native 在Android中使用工作方法来标题?
我想在ScrollView中使用WebView作为我的本机应用程序.但是如果我这样做,我就无法滚动我的webview,除非我在scrollview上禁用滚动.但是,我需要scrollview和webview中的滚动.有关如何完成此任务的任何建议或解决方案?
webview react-native react-native-scrollview react-native-android
嗨,我正在尝试使用navigate函数导航到下一个组件.我react-navigation用于多个组件之间的导航.
假设我有index.android.js和DashboardScreen.js组件.我试图DashboardScreen.js从索引组件导航到组件.
它正在导航,但索引组件始终保留在组件堆栈中.当我按回然后打开index.android.js它不应该.有谁知道如何管理这个react-native.在Android中,finish()适用于此.
navigate("DashboardScreen");
Run Code Online (Sandbox Code Playgroud)
当我从SplashScreen那里航行到EnableNotification那时SplashScreen应该被摧毁,如果我从EnableNotification那里航行到CreateMessage那时EnableNotification应该被摧毁,如果我从CreateMessage那里航行到DashboardScreen那时CreateMessage应该被摧毁.截至目前,没有任何组件被销毁.
index.android.js
class SplashScreen extends Component {
render() {
if (__DEV__) {
console.disableYellowBox = true;
}
const { navigate } = this.props.navigation;
AsyncStorage.getItem("@ProductTour:key").then(value => {
console.log(value);
if (value) {
navigate("DashboardScreen");
}
});
return (
....
);
}
}
const App = StackNavigator( …Run Code Online (Sandbox Code Playgroud)