Android Invalidate() only single view

前端 未结 2 394
一个人的身影
一个人的身影 2021-01-23 02:03

I have 2 views on RelativeLayout

I need to invoke(call) onDraw only single view

when I try view1.invalidate(); it also invoke(call) on

2条回答
  •  被撕碎了的回忆
    2021-01-23 02:23

    if view1 is overlapping with view2 when you call view1.invalidate(); it will re-draw every View that is overlapping with it .. so it will call view2.onDraw(); and since you are using RelativeLayout view1 and view2 maybe overlapped each other .

提交回复
热议问题