Android: Need to use onSizeChanged for View.getWidth/Height() in class extending Activity

后端 未结 5 2078
渐次进展
渐次进展 2020-12-15 20:15

I want to use getWidth()/getHeight() to get width/height of my XML-Layout. I read I have to do it in the method onSizeChanged() otherwise I will get 0 ( Android: Get the scr

5条回答
  •  半阙折子戏
    2020-12-15 21:06

    i think i know what you want to know........... i just wrote a new blog post on that right now........... how to get width and height dimensions of a customView (extends View) in Android http://syedrakibalhasan.blogspot.com/2011/02/how-to-get-width-and-height-dimensions.html

提交回复
热议问题