复习reactnative....
import React, { Component } from 'react';
import {
AppRegistry,
Text,
Image,
View,
TextInput,
ScrollView,
FlatList,
SectionList,
StyleSheet,
} from 'react-native';
export default class Test extends Component{
render(){
return(
// <View style={styles.container}>
// HelloWorld
// <Text>hello,Jim!</Text>
// Props(属性)
// <Image source={require('../image/baidu.png')} style={{width: 600, height: 200}} />
// <Greeting name='Leslie' />
// <Greeting name='Harold-hua' />
// <Blink text='cs' />
// 样式
// <Text style={styles.red}>red</Text>
// 宽高
// <View style={{width:50,height:50,backgroundColor:'skyblue'}} />
// <View style={{flex:1}}>
// <View style={{flex:1,backgroundColor:'skyblue'}} />
// <View style={{flex:1,backgroundColor:'blue'}} />
// <View style={{flex:3,backgroundColor:'red'}} />
// <View style={{flex:2,backgroundColor:'#000'}} />
// <View style={{flex:1,backgroundColor:'skyblue'}} />
// </View>
// 使用Flexbox布局
// <View style={{flex:1, flexDirection:'column', justifyContent:'space-between'}}>
// <View style={{width:50, height:50, backgroundColor:'red'}}></View>
// <View style={{width:50, height:50, backgroundColor:'blue'}}></View>
// </View>
// <View style={{flex:1, flexDirection:'column', justifyContent:'space-between',alignItems:'center'}}>
// <View style={{width:50, height:50, backgroundColor:'red'}}></View>
// <View style={{width:50, height:50, backgroundColor:'blue'}}></View>
// </View>
// <View style={{flex:1, flexDirection:'column', justifyContent:'space-between',alignItems:'center'}}>
// <View style={{width:50, height:50, backgroundColor:'red'}}></View>
// <View style={{width:50, height:50, backgroundColor:'blue'}}></View>
// </View>
// <PizzaTranslator />
// 使用滚动视图
// <IScrolledDownAndWhatHappenedNextShockedMe />
// 使用长列表1
// <FlatListBasics />
// 使用长列表2
// <SectionListBasics />
// </View>
<View style={styles.container}>
</View>
);
}
}
//State(状态)
// class Greeting extends Component{
// render(){
// return(
// <Text>Hello,{this.props.name}!</Text>
// );
// }
// }
// class Blink extends Component{
// constructor(shuxing){
// super(shuxing);
// this.state = {
// showText: true
// };
// setInterval(
// () => {
// this.setState(funName => {
// return{
// showText: !funName.showText
// };
// });
// }, 1000
// );
// }
// render(){
// let display = this.state.showText ? this.props.text:' ';
// return(
// <Text>{display}</Text>
// );
// }
// constructor(props){
// super(props);
// this.state = {
// showText: true
// };
// setInterval(() =>{
// this.setState(previousStatess => {
// return {
// showText: !previousState.showText
// };
// });
// }, 1000);
// }
// render(){
// let display = this.state.showText ? this.props.text:' ';
// return(
// <Text>{display}</Text>
// );
// }
// }
//处理文本输入
// class PizzaTranslator extends Component{
// constructor(props){
// super(props);
// this.state={
// text:''
// };
// }
// render(){
// return(
// <View style={{padding: 10}}>
// <TextInput
// style={{height:40}}
// placeholder="提示"
// onChangeText={(text)=>this.setState({text})}
// />
// <Text style={{padding:10, fontSize:42}}>
// {this.state.text.split(' ').map((word)=>word&& '
复习reactnative....的更多相关文章
- 【Hybird】274-Hybird App 应用开发中 5 个必备知识点复习
前言 我们大前端团队内部 ?每周一练 的知识复习计划还在继续,本周主题是 <Hybird APP 混合应用专题> ,这期内容比较多,篇幅也相对较长,每个知识点内容也比较多. 之前分享的每周 ...
- Hybird App 应用开发中5个必备知识点复习
前言 我们大前端团队内部 ?每周一练 的知识复习计划还在继续,本周主题是 <Hybird APP 混合应用专题> ,这期内容比较多,篇幅也相对较长,每个知识点内容也比较多. 之前分享的每周 ...
- iOS总结_UI层自我复习总结
UI层复习笔记 在main文件中,UIApplicationMain函数一共做了三件事 根据第三个参数创建了一个应用程序对象 默认写nil,即创建的是UIApplication类型的对象,此对象看成是 ...
- ReactNative入门 —— 动画篇(上)
在不使用任何RN动画相关API的时候,我们会想到一种非常粗暴的方式来实现我们希望的动画效果——通过修改state来不断得改变视图上的样式. 我们来个简单的示例: var AwesomeProject ...
- ReactNative入门(安卓)——API(下)
LayoutAnimation - layout动画 当布局发生改变时的动画模块,它有两个方法: 1. 最常用的方法是 LayoutAnimation.configureNext(conf<Ob ...
- ReactNative入门(安卓)——API(上)
Alert - 弹窗 通过 Alert.alert() 方法调用唤起原生弹窗,点击会触发 onPress 回调(参考下方代码)并清除弹窗. import React, { AppRegistry, C ...
- React-Native 组件开发方法
前言 React Native的开发思路是通过组合各种组件来组织整个App,在大部分情况下通过组合View.Image等几个基础的组件,可以非常方便的实现各种复杂的跨平台组件,不过在需要原生功能支持. ...
- React-Native 渲染实现分析
前言 React Native与传统的HybirdApp最大区别就是抛开WebView,使用JSC+原生组件的方式进行渲染,那么整个App启动/渲染流程又是怎样的呢? React Native启动流程 ...
- React-Native 动画优化
前言 动画对于客户端来说是非常重要的一部分,直接影响到应用的用户体验.前端对于动画优化通常使用CSS3样式来实现动画,以利用GPU加速特性.而React-Native由于渲染模式的不同,无法使用CSS ...
随机推荐
- JiBX笔记
注意事项 JiBX:1.2.2 (https://sourceforge.net/projects/jibx/files/jibx/jibx-1.2.2/) JDK:1.6 (http://www.o ...
- auto 和 decltype
一, auto 1, auto的作用 一般来说, 在把一个表达式或者函数的返回值赋给一个对象的时候, 我们必须要知道这个表达式的返回类型, 但是有的时候我们很难或者无法知道这个表达式或者函数的 ...
- whistle工具全程入门
接触过前后端开发的同学应该都了解网络请求代理工具fiddler(mac下面常用的是Charles),可以用来拦截分析请求.包装请求.本地调试和移动端代理开发调试等.多多少少,fiddler和Charl ...
- 题解-Atcoder_agc005D ~K Perm Counting
Problem AtCoder-agc005D 题意概要:给出\(n,k\),求合法的排列个数,其中合法定义为任何数字所在位置与自身值差的绝对值不为\(k\)(即求排列\(\{A_i\}\),使得\( ...
- HashMap多线程put后get为null和多线程put的时候可能导致元素丢失
一.多线程put后get为null 源码定位 void transfer(Entry[] newTable) { Entry[] src = table; int newCapacity = newT ...
- <杂记>该换个背景图了
..当然我刚开始也是懵逼的,我有发现这里可以写css,但是还是缺个图片地址,想了想,这不是还有个相册功能吗. 那应该就是把自己要换的图片上传到相册吧. 右击图片,选择检查元素找到图片的src 如:ht ...
- linux 常用的中文手册
http://linuxtools-rst.readthedocs.io/zh_CN/latest/base/index.html 总结的非常好!包括基础.进阶以及各种常用工具.
- maven项目板块的pom.xml配置
项目名为helloweb 项目文件结构图1 helloweb>pom.xml内容如下: <project xmlns="http://maven.apache.org/POM/4 ...
- MSSQL—行转列
行转列,是SQL中经常会遇到的一个问题,并且分为静态转换和动态转换,所谓静态转换即在转换的行数已知或固定:动态转换则为转换的行数不固定. 转换的方法一般采用case when语句或pivot(MSSQ ...
- Ex 2_25 n位十进制整数转换为二进制形式..._第四次作业
(a) 当n=1时,(10)d=(1010)b 当n=2时,(100)d=(10)d x (10)d=(1010)b x (1010)b 当n=4时,(10000)d=(100)d x (100) ...