DragLinearLayout庫的實現工作正常,直到我還實現了Android的LayoutTransition。DragLinearLayout庫在使用LayoutTransition實現時在運行時崩潰
我得到這個錯誤:
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
And I get runtime errors on these two methods in the DragLinearLayout class :
1. addView(draggedItem.view, switchPosition); //called in on drag
2. onDrag(deltaY); // called in the onTouchEvent override method.
我停止了它在我的執行活動覆蓋的onTouchEvent()崩潰,並設置setLayoutTransition參數爲空的DraggerLinearLayout當行被觸摸,然後在DragLinearLayout當onAnimaitonEnd被調用時,我在我的實現活動中調用一個方法,並使setLayoutTransition()參數不再爲空。
但是,這會導致一些滯後,並且在您停止拖動並讓它解決時拖動的那一行,它會消失一秒鐘,然後再次出現。
有沒有辦法用這個庫實現LayoutTransition,或者使用動畫來添加行的任何其他推薦技術,以及爲DragLinearLayout的遞增大小設置動畫效果?
在此先感謝。