ViewGroup很少会用到得东西
轻量级的移除和添加view,addView和removeView都是重量级的操作,会触发重绘,导致卡顿。
detachViewFromParent(View view, int index, LayoutParams params)
removeDetachedView(View view,boolean animate)
效果:
实现:
1 | private fun moveToTop(target: View) { |
轻量级的移除和添加view,addView和removeView都是重量级的操作,会触发重绘,导致卡顿。
detachViewFromParent(View view, int index, LayoutParams params)
removeDetachedView(View view,boolean animate)
效果:
实现:
1 | private fun moveToTop(target: View) { |