复习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 ...
随机推荐
- EditText设置可以点击,但是不可以编辑
EditText设置 editText.setEnabled(false);后不可编辑也不可点击 设置 setFocusable(false)后不可编辑,但是再设置 setFocusable(tr ...
- [转] 解决Driver/library version mismatch
跑模型 torch.cuda.is_available()返回 False nvidia-smi返回:Failed to initialize NVML: Driver/library version ...
- Datasnap 服务端 (Server)Session 管理 --- 解决 全示例慢(Google)
Datasnap 服务端 (Server)Session 管理: http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Server_Side_Ses ...
- vue之登录和token处理
应用场景一 Vue刷新token,判断token是否过期.失效,进行登录判断跟token值存储 刷新token和token是否过期的操作都是由后端实现,前端只负责根据code的不同状态来做不同的操作: ...
- 使用命令行解析php文件
使用命令行解析php文件,这样可以调用Log4PHP库中的一些demo,因为默认的输出使用命令行作为输出. 建一个bat文件: echo 以下是使用命令行解析php文件 C:\xampp\php\ph ...
- CORS(Cross-origin resource sharing) “跨域资源共享”
CORS与JSONP的比较 在出现CORS标准之前, 我们还只能通过jsonp的形式去向“跨源”服务器去发送 XMLHttpRequest 请求,这种方式吃力不讨好,在请求方与接收方都需要做处理,而且 ...
- 模块 -- 序列化 hashlib sha logging (加密 加盐 )
模块: 一个py文件就是一个模块 模块分类: 1:内置模块,登录模块,时间模块,sys模块,os模块等等 2: 扩展模块, 3:自定义模块,自己写的py文件 python 开发效率之高:python ...
- Python-Django-Ajax进阶
ajax上传文件: <h2>基于ajax上传文件</h2><p>名字 <input type="text" id="filena ...
- python之hashlib
简介: 用于加密相关的操作,代替了md5模块和sha模块,主要提供SHA1,SHA224,SHA256,SHA384,SHA512,MD5算法.在python3中已经废弃了md5和sha模块,简单说明 ...
- 大数据python词频统计之hdfs分发-cacheFile
-cacheFile 分发,文件事先上传至Hdfs上,分发的是一个文件 1.找一篇文章The_Man_of_Property.txt: He was proud of him! He could no ...