Frage

If I invalidate view1 then my view2 is redrawn. I like to only redraw my view1.

I have: 2 Custom Views -> view1 & view2 1 LinearLayout

I visually switch between the view1 and view2 with:

LinearLayout.removeAllViews();
LinearLayout.addView(view2) or LinearLayout.addView(view1);

How can I invalidate view1 without triggering the drawing of view2 ?

War es hilfreich?

Lösung

The better way is to change visibility of views instead of remove and add to container. It will work faster and view with visibility gone will not redraw on invalidate.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top