Android(安卓)View创建和销毁调用的所有方法
16lz
2021-01-25
很久没有写东西了,今天来公司比较早,弄个小知识,了解View的动作,才能让它有更大的作为
View 的创建
setOverScrollMode()setLayoutParams()requestLayout()hasFocus()hasTransientState()isClickable()isLongClickable()getAccessibilityNodeProvider()dispatchVisibilityChanged()onVisibilityChanged()dispatchVisibilityChanged()onVisibilityChanged()jumpDrawablesToCurrentState()jumpDrawablesToCurrentState()jumpDrawablesToCurrentState()onAttachedToWindow()jumpDrawablesToCurrentState()isFocused()onWindowVisibilityChanged()refreshDrawableState()drawableStateChanged()getVisibility()getLayoutParams()onMeasure()getSuggestedMinimumWidth()getSuggestedMinimumHeight()getLayoutParams()getVisibility()getLayoutParams()layout()isOpaque()onSizeChanged()isOpaque()getMatrix()isOpaque()onLayout()requestFocus()forceLayout()dispatchWindowFocusChanged()onWindowFocusChanged()refreshDrawableState() drawableStateChanged()getVisibility()getLayoutParams()onMeasure()getSuggestedMinimumWidth()getSuggestedMinimumHeight()getLayoutParams()getVisibility()getLayoutParams()layout()onLayout()getLayerType()getAnimation()getLayerType()computeScroll()draw()onDraw()dispatchDraw()hasOverlappingRendering()
点击View方法执行顺序
dispatchTouchEvent()onFilterTouchEventForSecurity()onTouchEvent()
下拉状态栏,会执行下面方法。
dispatchWindowFocusChanged()onWindowFocusChanged()isPressed()isPressed()refreshDrawableState()drawableStateChanged()
返回键退出状态栏
dispatchWindowFocusChanged()onWindowFocusChanged()refreshDrawableState()drawableStateChanged()
锁屏
onScreenStateChanged()dispatchSaveInstanceState()
解屏
onScreenStateChanged()
旋转
dispatchSaveInstanceState()onWindowVisibilityChanged()onDetachedFromWindow()destroyDrawingCache()setOverScrollMode()setLayoutParams()requestLayout()hasFocus()hasTransientState()isClickable()isLongClickable()getAccessibilityNodeProvider()dispatchRestoreInstanceState()dispatchVisibilityChanged()onVisibilityChanged()dispatchVisibilityChanged()onVisibilityChanged()jumpDrawablesToCurrentState()jumpDrawablesToCurrentState()jumpDrawablesToCurrentState()onAttachedToWindow()jumpDrawablesToCurrentState()isFocused()onWindowVisibilityChanged()refreshDrawableState()drawableStateChanged()getVisibility()getLayoutParams()onMeasure()getSuggestedMinimumWidth()getSuggestedMinimumHeight()getLayoutParams()getVisibility()getLayoutParams()layout()isOpaque()onSizeChanged()isOpaque()getMatrix()isOpaque()onLayout()requestFocus()forceLayout()dispatchWindowFocusChanged()onWindowFocusChanged()refreshDrawableState()drawableStateChanged()getVisibility()getLayoutParams()onMeasure()getSuggestedMinimumWidth()getSuggestedMinimumHeight()getLayoutParams()getVisibility()getLayoutParams()layout()onLayout()getLayerType()getAnimation()getLayerType()computeScroll()draw()onDraw()dispatchDraw()hasOverlappingRendering()
退出
dispatchWindowFocusChanged()onWindowFocusChanged()isPressed()isPressed()refreshDrawableState()drawableStateChanged()dispatchWindowVisibilityChanged()onWindowVisibilityChanged()onDetachedFromWindow()destroyDrawingCache()
更多相关文章
- android native jni 代码
- Android(安卓)Java笔试题(带大部分答案)
- android 拍照或从相册获取图片 返回 bitmap
- Android基于ViewPager+Fragment实现左右滑屏效果的方法
- Android细节问题总结(二)
- android调用matlab中的函数方法
- Android媒体扫描代码分析
- Android中banner的使用步骤
- Android(安卓)中Edittext设置不弹出软键盘