Home > Blockchain >  ViewCompat.isLaidOut explanation
ViewCompat.isLaidOut explanation

Time:10-15

The method isLaidOut of ViewCompat has a description:

Returns true if view has been through at least one layout since it was last attached to or detached from a window.

And I don't understand the meaning of: through at least one layout.

For me a word layout means a place where I put my views, like LinearLayout, FrameLayout, etc. Maybe this method is intended to check views which are created programmatically but not placed in any layout.

But phrase through at least one layoutmeans that it can happens more than 1 time. This is completely beyond my understanding. So, what that phrase means?

CodePudding user response:

Android must do a pass though the views hierarchy to decide each view's size and where to place it in the layout (LinearLayout, FrameLayout, etc.) Part of this process is called the "layout pass" where the views are placed into position.

Returns true if view has been through at least one layout since it was last attached to or detached from a window.

could read

Returns true if view has been through at least one layout pass since it was last attached to or detached from a window.

  • Related