2
不當叫我有一個自定義FrameLayout
和XML文件,它有2個孩子(兩個都是RelativeLayout
,他們相互重疊)requestLayout()由RelativeLayout的
在drawChild
方法我做這個
protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
if(view.equals(firstChild){
return super.drawChild(canvas, child, drawingTime);
}else {
//...do some thing with mPath like adding a circle to it
canvas.clipPath(mPath);
return super.drawChild(canvas, child, drawingTime);
}
}
但我從logcat的這兩條線:
requestLayout() improperly called by android.widget.RelativeLayout{c1a8b57 V.E...... ......ID 0,0-1080,210} during second layout pass: posting in next frame
requestLayout() improperly called by android.widget.RelativeLayout{c1a8b57 V.E...... ......ID 0,0-1080,210} during layout: running second layout pass
我知道有一些錯誤clipPath
(也許Ø verlapping),因爲警告通過評論這條線canvas.clipPath(mPath);
消失。
任何想法?
「如果我改變的第二個孩子來走了知名度」,這會導致第二個孩子從來沒有送測,laidout,並繪製。 – petey
@petey是啊我知道,我編輯我的問題 –