Вопрос

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 ?

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top