If this view doesn't do any drawing on its own, set this flag to allow further optimizations. By default, this flag is not set on View, but could be set on some View subclasses such as ViewGroup. Typically, if you override onDraw(android.graphics.Canvas)
you should clear this flag.
默认情况下 viewgroup并不会调用ondraw ,除非为其设置背景色;所以当使用自定义viewgroup,需要在viewgroup 绘制特殊图样时,可调用该setWillNotDraw (false),或者为viewgroup设置背景色,从而令其调用ondraw方法。