-->

有Android的观点生命周期(状态图)的任何图形表示? [关闭](Is there any g

2019-08-02 03:20发布

我们都知道在Android 活动的生命周期和碎片的生命周期秒。 但有什么等效看法?

这可以帮助,例如,建立自定义视图或给出一个深入了解在Android上很常见,往往是隐藏的图形操作。

提前致谢 !

Answer 1:

这不是一个正式文件,但这个最近想出了在Google+上。 的意见,也有一些详细的解释了很好的讨论。



Answer 2:

在这里,我创建了一个扩展视图自定义视图。 然后,在每个方法写日志。 这里的所谓方法的顺序:
当运行调试
setOverScrollMode
setOverScrollMode
onFinishInflate
setLayoutParams
getLayoutDirection
requestLayout
hasFocus
hasTransientState
getVisibility
getLayoutDirection
getLayoutDirection
canResolveLayoutDirection
getLayoutDirection
canResolveTextDirection
isLayoutDirectionResolved
isLayoutDirectionResolved
getLayoutDirection
getLayoutDirection
isLayoutDirectionResolved
isTextDirectionResolved
isTextAlignmentResolved
getLayoutDirection
jumpDrawablesToCurrentState
jumpDrawablesToCurrentState
jumpDrawablesToCurrentState
jumpDrawablesToCurrentState
jumpDrawablesToCurrentState
jumpDrawablesToCurrentState
getVisibility
onAttachedToWindow
jumpDrawablesToCurrentState
的getBackground
isFocused
被示
onVisibilityAggregated
refreshDrawableState
drawableStateChanged
onCreateDrawableState
isFocused
hasWindowFocus
getVisibility
onMeasure
getSuggestedMinimumWidth
getSuggestedMinimumHeight
getVisibility
getVisibility
onMeasure
getSuggestedMinimumWidth
getSuggestedMinimumHeight
getVisibility
getVisibility
布局
isOpaque
onSizeChanged
的getBackground
isOpaque
getMatrix
isOpaque
isHardwareAccelerated
盖茨
getElevation
getTranslationZ
onLayout
getVisibility
getAnimation
getLayerType
getLayerType
computeScroll

的onDraw
dispatchDraw
onDrawForeground
hasOverlappingRendering
dispatchWindowFocusChanged
onWindowFocusChanged
refreshDrawableState
drawableStateChanged
onCreateDrawableState
isFocused
hasWindowFocus

打开活动这一观点:
onScreenStateChanged
getLayoutDirection
getAnimation
getLayerType
getVisibility
getVisibility
getVisibility
布局
getVisibility
dispatchWindowFocusChanged
onWindowFocusChanged
refreshDrawableState
drawableStateChanged
onCreateDrawableState
isFocused
hasWindowFocus



文章来源: Is there any graphical representation of Android views lifecycle (a state diagram)? [closed]