0%

1.import _

import 下划线(如:import _ hello/imp)的作用:当导入一个包时,该包下的文件里所有init()函数都会被执行,然而,有些时候我们并不需要把整个包都导入进来,仅仅是是希望它执行init()函数而已。这个时候就可以使用 import _ 引用该包。即使用【import _ 包路径】只是引用该包,仅仅是为了调用init()函数,所以无法通过包名来调用包中的其他函数。

2.import .

import( . “fmt” ) 这个点操作的含义就是这个包导入之后在你调用这个包的函数时,你可以省略前缀的包名,也就是前面你调用的fmt.Println(“hello world”) 可以省略的写成Println(“hello world”)

3.import f

import( f “fmt” ) 别名操作调用包函数时前缀变成了重命名的前缀,即f.Println(“hello world”)

Read more »

React-Native ListView性能

优化方案

1.使用react-native-sglistview、react-native-gifted-listview
2.设置removeClippedSubviews 为true,子类需要添加样式overflow:’hidden’
3.设置拖动速率 decelerationRate
4.dataSource里的数组个数做限制,做分页处理,10~15一页
5.在sholudComponentUpdate处理,确保不要重复刷新
6.上拉下拉刷新操作,加载过程中隐藏listview,显示加载界面

Read more »

###1. CSS text-decoration 属性
none 默认。定义标准的文本。
underline 定义文本下的一条线。
overline 定义文本上的一条线。
line-through 定义穿过文本下的一条线。
blink 定义闪烁的文本。
inherit 规定应该从父元素继承 text-decoration 属性的值。

Read more »

1.定义

A higher-order component is a function that takes a component and returns a new component.

Read more »

在Mac上使用apche2

1.基本命令

Mac上自带apache2,它的安装目录是/etc/apach2, 文档目录在/Library/WebServer/Documents/

1
2
3
4
5
6
#启动apche2 由于80端口需要管理者权限
sudo apachectl start
#关闭
sudo apachectl stop
#重启
sudo apachectl restart
Read more »

1. Image overflow

Image是可以overflow:display,这个在android和ios都有效果。而View在android上不可以overflow:display的。

Read more »