Today in the study itself defines the effect of the drop-down refresh of the ListView. Want to transplant to the project requirements, and then look at their own definition of the source code found a problem is getwidth and getmeasuredwidth two methods what difference, ask the almighty Baidu, after investigation found that the difference between the two methods is, GetWidth gets the visible width of the current view, but pull down to refresh the demand, the view of the head hint is hidden so that the getwidth can not get the width of the view. So take the getmeasuredwidth way to get it.
The Getmeasuredwidth method represents the ability to get the visual width of the view + the width of the hidden place. In this demand our headview is always hidden, so there is only one way to get to the desired width through this getmeasuredwidth method, and a picture represents the principle I'm talking about, which is more intuitive.
Special Thanks post address: http://blog.sina.com.cn/s/blog_6e519585010152s5.html
The difference between getwidth and getmeasuredwidth in the view window of Android