摘要: 参考:https://facebook.github.io/react/docs/components-and-props.html 一些独立,可重用的界面可以使用Components封装。 (一)Components定义 可以使用函数或者ES6的class定义Components,后者有一些额外的 阅读全文
posted @ 2017-07-22 11:52 sheshihao 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 参考:https://facebook.github.io/react/docs/rendering-elements.html (一)Element 1.Element是react中最小的构建单元,是一个对象不是DOM,创建的代价比较低。 (1)通常我们在代码中使用JSX定义一个Element: 阅读全文
posted @ 2017-07-22 10:36 sheshihao 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 参考:https://facebook.github.io/react/docs/introducing-jsx.html 一、JSX介绍 二、JSX使用 1.使用大括号嵌入js表达式 2.JSX编译之后是js对象,也就是说,可以赋值给变量,作为参数,或者函数返回值等等 3.使用JSX为属性赋值 4 阅读全文
posted @ 2017-07-10 17:43 sheshihao 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 一、render方法 参考https://itbilu.com/javascript/react/EJiqU81te.html React的组件最终通过render方法渲染到DOM中,该方法由ReactDOM类库提供。API如下: 二、动手写一个Hello World 1.接着上一次打开webpac 阅读全文
posted @ 2017-07-10 17:08 sheshihao 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 一、搭建新工程 参考:https://facebook.github.io/react/docs/installation.html npm install -g create-react-app//npm安装create-react-app create-react-app my-app//使用c 阅读全文
posted @ 2017-07-10 16:21 sheshihao 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 参考了《深入理解Android网络编程》这本书我们都知道TCP和UDP最大的区别就是,TCP是面向连接的,而UDP是无连接的。那么使用TCP和UDP编程,事实上差别也是在这里:1.使用TCP通讯:分为客户端和服务器,主要是先初始化,像IP,端口这些肯定要先绑定的,服务器等待客户端连接,连接之后,通过... 阅读全文
posted @ 2015-10-03 23:29 sheshihao 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 一、工具博主用的几个软件版本信息如下(大家根据自己电脑的位数选择):1、jdk版本:jdk-8u40-windows-i586-8.0.40.25.exe下载地址:http://www.oracle.com/technetwork/articles/javase/index-jsp-138363.h... 阅读全文
posted @ 2015-05-04 19:59 sheshihao 阅读(403) 评论(0) 推荐(0) 编辑
摘要: 指针变量与间址访问能够存放地址值的变量成为指针变量声明:int *p;//在变量说明语句中,*是表示指针类型,也就是用来说明p是存放地址的变量int a=10;p=&a;coutusing namespace std;int main(){long int a=10,b=20,temp;long i... 阅读全文
posted @ 2015-04-10 11:12 sheshihao 阅读(467) 评论(0) 推荐(0) 编辑
摘要: 在类中声明一个类方法的举例:public static void main(String args[]);类方法可以在类没有实例化的时候通过类名直接调用一个类的main方法必须用static修饰,因为java运行时系统在开始执行一个程序前,并没有生成类的一个实例,它只能通过类名来调用main方法作为... 阅读全文
posted @ 2015-04-08 17:19 sheshihao 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 二、静态注册——让程序在未启动的情况下就能接收到广播1、还是先创建一个类继承自BroadcastReceiver2、重写onReceive方法--下面几步在AndroidManifest.xml中修改3、定义一对标签(有点类似activity标签)4、在receiver标签里面定义“过滤器”5、当程... 阅读全文
posted @ 2015-04-07 13:38 sheshihao 阅读(176) 评论(0) 推荐(0) 编辑