请问精通Android开发的大侠谁知道画直线的getMeasuredHeight()和getMeasuredWidth()是获得什么值呢 ?
有谁看过Android高级编程的这本书,我在书本中提供的网站(http://www.wrox.com)下载的源代码都有错误的。请问哪里有得下载正确的源代码呢?
书上的例子todolist有哪位高人正确的在模拟机上运行了呢??或者有代码也可以发给小弟参考下,可否。
本人QQ:659276192
不胜感激!!

解决方案 »

  1.   

    getMeasuredHeight
    getMeasuredWidth
    是获取view的宽高
      

  2.   

    那getHeight和getWidth是获得谁的宽高?
      

  3.   

    看sdk:
    public final int getMeasuredHeight ()Since: API Level 1
    The height of this view as measured in the most recent call to measure(). This should be used during measurement and layout calculations only. Use getHeight() to see how tall a view is after layout.这个函数是在你调用measure之后计算出的高度,如果你layout变化了,也就是size变了,需要通过measure来重新计算view的高度,计算完后,getMeasuredHeight和getHeight这时是一样的。步骤上有区别
      

  4.   

    这个视图的高度在最近的一个测量叫来衡量()。这应该是用在测量和布局的计算只。(使用)去看getHeight多么高的观点是后的布局。
    有点明白了,能给点例子么?