Behavior of setwillnotdraw(false)

前端 未结 1 612
别跟我提以往
别跟我提以往 2021-01-12 00:00

I am new comer to the android and got stuck with this concept.

I have extended FrameLayout and added child views. My child view\'s onDraw i

相关标签:
1条回答
  • 2021-01-12 00:26

    The flag is not set usually on View. This flag is set to true of ViewGroup, and by default their onDraw is not called. You have to call setWillNotDraw(false), to make the onDraw of your subclass of ViewGroup being called.

    Also, if you don't want that onDraw in your view's subclass to be called, you have to call subclassInstance.setWillNotDraw(true)

    0 讨论(0)
提交回复
热议问题