質問

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