当前位置:   article > 正文

Android View创建和销毁调用的所有方法_android studio中view的创建和销毁

android studio中view的创建和销毁

很久没有写东西了,今天来公司比较早,弄个小知识,了解View的动作,才能让它有更大的作为

View 的创建 

  1. setOverScrollMode()
  2. setLayoutParams()
  3. requestLayout()
  4. hasFocus()
  5. hasTransientState()
  6. isClickable()
  7. isLongClickable()
  8. getAccessibilityNodeProvider()
  9. dispatchVisibilityChanged()
  10. onVisibilityChanged()
  11. dispatchVisibilityChanged()
  12. onVisibilityChanged()
  13. jumpDrawablesToCurrentState()
  14. jumpDrawablesToCurrentState()
  15. jumpDrawablesToCurrentState()
  16. onAttachedToWindow()
  17. jumpDrawablesToCurrentState()
  18. isFocused()
  19. onWindowVisibilityChanged()
  20. refreshDrawableState()
  21. drawableStateChanged()
  22. getVisibility()
  23. getLayoutParams()
  24. onMeasure()
  25. getSuggestedMinimumWidth()
  26. getSuggestedMinimumHeight()
  27. getLayoutParams()
  28. getVisibility()
  29. getLayoutParams()
  30. layout()
  31. isOpaque()
  32. onSizeChanged()
  33. isOpaque()
  34. getMatrix()
  35. isOpaque()
  36. onLayout()
  37. requestFocus()
  38. forceLayout()
  39. dispatchWindowFocusChanged()
  40. onWindowFocusChanged()
  41. refreshDrawableState()
  42.  drawableStateChanged()
  43. getVisibility()
  44. getLayoutParams()
  45. onMeasure()
  46. getSuggestedMinimumWidth()
  47. getSuggestedMinimumHeight()
  48. getLayoutParams()
  49. getVisibility()
  50. getLayoutParams()
  51. layout()
  52. onLayout()
  53. getLayerType()
  54. getAnimation()
  55. getLayerType()
  56. computeScroll()
  57. draw()
  58. onDraw()
  59. dispatchDraw()
  60. hasOverlappingRendering()

点击View方法执行顺序

  1. dispatchTouchEvent()
  2. onFilterTouchEventForSecurity()
  3. onTouchEvent()

下拉状态栏,会执行下面方法。
 

  1. dispatchWindowFocusChanged()
  2. onWindowFocusChanged()
  3. isPressed()
  4. isPressed()
  5. refreshDrawableState()
  6. drawableStateChanged()


返回键退出状态栏
 

  1. dispatchWindowFocusChanged()
  2. onWindowFocusChanged()
  3. refreshDrawableState()
  4. drawableStateChanged()


锁屏

  1. onScreenStateChanged()
  2. dispatchSaveInstanceState()

解屏
 

onScreenStateChanged()


旋转

  1. dispatchSaveInstanceState()
  2. onWindowVisibilityChanged()
  3. onDetachedFromWindow()
  4. destroyDrawingCache()
  5. setOverScrollMode()
  6. setLayoutParams()
  7. requestLayout()
  8. hasFocus()
  9. hasTransientState()
  10. isClickable()
  11. isLongClickable()
  12. getAccessibilityNodeProvider()
  13. dispatchRestoreInstanceState()
  14. dispatchVisibilityChanged()
  15. onVisibilityChanged()
  16. dispatchVisibilityChanged()
  17. onVisibilityChanged()
  18. jumpDrawablesToCurrentState()
  19. jumpDrawablesToCurrentState()
  20. jumpDrawablesToCurrentState()
  21. onAttachedToWindow()
  22. jumpDrawablesToCurrentState()
  23. isFocused()
  24. onWindowVisibilityChanged()
  25. refreshDrawableState()
  26. drawableStateChanged()
  27. getVisibility()
  28. getLayoutParams()
  29. onMeasure()
  30. getSuggestedMinimumWidth()
  31. getSuggestedMinimumHeight()
  32. getLayoutParams()
  33. getVisibility()
  34. getLayoutParams()
  35. layout()
  36. isOpaque()
  37. onSizeChanged()
  38. isOpaque()
  39. getMatrix()
  40. isOpaque()
  41. onLayout()
  42. requestFocus()
  43. forceLayout()
  44. dispatchWindowFocusChanged()
  45. onWindowFocusChanged()
  46. refreshDrawableState()
  47. drawableStateChanged()
  48. getVisibility()
  49. getLayoutParams()
  50. onMeasure()
  51. getSuggestedMinimumWidth()
  52. getSuggestedMinimumHeight()
  53. getLayoutParams()
  54. getVisibility()
  55. getLayoutParams()
  56. layout()
  57. onLayout()
  58. getLayerType()
  59. getAnimation()
  60. getLayerType()
  61. computeScroll()
  62. draw()
  63. onDraw()
  64. dispatchDraw()
  65. hasOverlappingRendering()

退出
 

  1. dispatchWindowFocusChanged()
  2. onWindowFocusChanged()
  3. isPressed()
  4. isPressed()
  5. refreshDrawableState()
  6. drawableStateChanged()
  7. dispatchWindowVisibilityChanged()
  8. onWindowVisibilityChanged()
  9. onDetachedFromWindow()
  10. destroyDrawingCache()

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/494811
推荐阅读
相关标签
  

闽ICP备14008679号