Do I need to call back super.onDraw() in a custom view?

后端 未结 4 1820
情歌与酒
情歌与酒 2021-02-07 06:35

I\'m not too clear about this and neither are the docs.

When I\'m creating a custom view, I override like so:

@Override
public void onDraw(Canvas canvas)         


        
4条回答
  •  盖世英雄少女心
    2021-02-07 06:48

    It's not required unless you are actually overriding the onDraw() method. If the new class doesn't override it, the super's method will automatically be called.

提交回复
热议问题