Confused with removeAllViewsInLayout (), postInvalidate () and refreshDrawableState ()

I'm really confused by these three functions: removeAllViewsInLayout(), postInvalidate()and refreshDrawableState().

removeAllViewsInLayout()

When I use removeAllViewsInLayout()in my program, all views have disappeared. But when the trigger is postInvalidate()updated, nothing. I think that removeAllViewsInLayout()deletes all my submissions. Is there a way to clear everything in my opinion but not delete it?

postInvalidate()

I want to update my presentation. But with refreshDrawableState(), I can only do it once, why?

+5
source share
1 answer

postInvalidate() ( invalidate(), ), . onDraw() , , .

removeAllViewsInLayout(), - , . , , . (EDIT: removeAllViewsInLayout() ViewGroup. ViewGroup, "" , onLayout() , . , removeAllViews().)

refreshDrawableState() , Drawable, . , , . , , .

+7

All Articles