近半年,自己创业做在线教育,近期也打算开发自己的APP,作为一个技术出身的创业者,所以可以在开发APP时自己做 […]
react-navigation示例
App.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
import React, { Component } from 'react' import { Platform, StyleSheet, Text, View } from 'react-native' import { createStackNavigator, createAppContainer } from 'react-navigation' import HomeScreen from './pages/HomeScreen' import ProfileScreen from './pages/ProfileScreen.js' const navigator = createStackNavigator({ Home: { screen: HomeScreen }, Profile: { screen: ProfileScreen } }) const App = createAppContainer(navigator) export default App const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF' }, welcome: { fontSize: 20, textAlign: 'center', margin: 10 }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5 } }) |
pages/Pr […]
处理文本输入
TextInput是一个允许用户输入文本的基础组件。它有一个名为onChangeText的属性,此属性接受一个 […]
使用Flexbox布局
我们在 React Native 中使用 flexbox 规则来指定某个组件的子元素的布局。Flexbox 可 […]
样式
本文档贡献者:sunnylqm(100.00%) 在 React Native 中,你并不需要学习什么特殊的语 […]
State(状态)
我们使用两种数据来控制一个组件:props和state。props是在父组件中指定,而且一经指定,在被指定的组 […]
Props(属性)
大多数组件在创建时就可以使用各种参数来进行定制。用于定制的这些参数就称为props(属性)。 以常见的基础组件 […]