在listview的getview中setData(),在子view的setdata(),onlayout(),onmeasure()方法中写上log,
发现setdata(),最先执行,onmeasure()执行了2次,onlayout()执行了一次,通过看listview源码找到原因。

  • getHeightForPosition()方法中view.measure()
  • obtainView()方法中child.setLayoutParams(lp),而setLayoutParams()又会执行requestLayout()
    1
    2
    3
    4
    5
    log
    data->com.nice.main.data.enumerable.Show@17239164setdata
    data->com.nice.main.data.enumerable.Show@17239164onMeasure
    data->com.nice.main.data.enumerable.Show@17239164onMeasure
    data->com.nice.main.data.enumerable.Show@17239164onLayout
阅读全文 »

string.xml 中的转义

  • ‘ “需要用\转义或对整个字符串加上 “”

    1
    2
    <string name="good_example">This\'ll work</string>
    <string name="good_example_2">"This'll also work"</string>
阅读全文 »

创建github仓库

在github中创建一个名字为 xxx.github.io 的仓库,xxx为github为账号。

使用hexo 主题

安装软件

  • 安装Node.js
    node.js官网
  • 安装Hexo
    1
    $ npm install -g hexo-cli
阅读全文 »

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment