复习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 ...
随机推荐
- CXF2.7整合spring发布webservice
---------==========--服务端发布webservice-=============-------- 1.需要的jar包: 2.包结构 3.代码 1.实体类 package cn.ql ...
- SpringMVC中请求路径参数使用正则表达式
@GetMapping("/user/{id:\\d+}") //使用正则指定Id为数字 public User getInfo(@PathVariable String id){ ...
- replicate_wild_do_table和replicate-wild-ignore-table的使用【转】
使用replicate_do_db和replicate_ignore_db时有一个隐患,跨库更新时会出错. 如在Master(主)服务器上设置 replicate_do_db=test(my.conf ...
- Git学习笔记07-删除文件
在Git中,删除也是一种修改.先新建一个文件,添加并提交.然后删除下看看. 一般删除直接从工作区把文件删了,或者使用rm命令 这是使用git status查看状态,会告诉我们删了哪个文件 这个 ...
- C++ URLencode library
I need a library that can URLencode a string/char array. Now, I can hex encode an ASCII array like h ...
- Tomcat服务的安装及配置
在进行Java Web开发时必须有Web服务器的支持,常用的Web服务器便是Tomcat,本文主要介绍Tomcat的安装和配置.客户端通过Web浏览器发送一个基于HTTP协议的请求到服务器上后,服务器 ...
- BeautifulSoup解析器的选择
BeautifulSoup解析器 在我们使用BeautifulSoup的时候,选择怎样的解析器是至关重要的.使用不同的解析器有可能会出现不同的结果! 今天遇到一个坑,在解析某html的时候.使用htm ...
- ASP.NET的路由系统:路由映射
总的来说,我们可以通过RouteTable的静态属性Routes得到一个基于应用的全局路由表,通过上面的介绍我们知道这是一个类型的RouteCollection的集合对象,我们可以通过调用它的MapP ...
- Win10 SQL Server 2017安装教程
Win10 SQL Server 2017安装教程 1:下载地址 2:开始安装 1:安装环境预备说明 还要注意就是要先下载这个VC++的更新,可以解决服务器安装不上的问题,下载链接 :Microsof ...
- Confluence 6 编辑站点欢迎消息使用模板编辑器的小提示
站点欢迎消息是一个模板而不是一个页面,所以你需要使用模板编辑器来对你的消息进行编辑. 你可以和在你 Confluence 中其他页面中一样,在站点欢迎消息模板中添加文本,连接和宏.但是添加图片的话会有 ...