views:

49

answers:

0

Hi, guys I am new to Android development, just reading docs and trying the APIs. I am quit confused how ImageView managed to draw just a part of its content after an invalidate(Rect) invocation.

I've checked ImageView.java, found no other drawing method except onDraw(Canvas), but onDraw(Canvas) only cut the drawable only if it is beyound the view's visible boundary. I also read the implementation of View.invalidate(Rect), I think the key of this function is calling to mParent.invalidateChild(this, r); However, I think the parent view doesn't know how to draw the child in the given Rect, it finally has to call some method of it child to paint out.

Has anybody investigated this part of codes? Would you please give me some guide?