getWidth and getHeight are returning a zero

后端 未结 6 1558
一整个雨季
一整个雨季 2020-12-03 07:12

I am trying to make a simple drawing program for the android.

I have a custom View class to handle the drawing. When I call its getWidth an

6条回答
  •  一个人的身影
    2020-12-03 07:45

    The view only has dimensions after beeing displayed for the first time.

    Other thing:

    int h=getHeight();
    h=400;
    

    Is useless no ? Is it just for testing ?

提交回复
热议问题