Domanda

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 ?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top