To use the layout inspector plugin, you need to add the plugin to your Flipper client instance.
Standard Android View Only
With Litho Support
Litho support is provided via an optional plugin.
You also need to compile in the
litho-annotations package, as Flipper reflects
on them at runtime. So ensure to not just include them as
compileOnly in your
If you want to enable Litho support in the layout inspector, you need to augment the descriptor with Litho-specific settings and add some addition dependencies.
Blocking fullscreen views (Android only)
The issue is that if you have some view that occupies big part of the screen but draws nothing and its Z-position is higher than your main content, then selecting view/component through Layout Inspector doesn't work as you intended, as it will always hit that transparent view and you need to manually navigate to the view you need which is time-consuming and should not be necessary.
Add the following tag to your view to skip it from Flipper's view picker. The view will still be shown in the layout hierarchy, but it will not be selected while using the view picker.
Blocking empty view groups (Android only)
If you have a ViewGroup that only occasionally has visible children, you may find it helpful to block its traversal when it is empty or has no visible children. For example, you might have a FragmentContainerView that currently has no visible fragment.
Add the following tag to your view group to skip it from Flipper's view picker only when it has zero children, or none of its children are currently visible. The views will still be shown in the layout hierarchy, but they will not be selected while using the view picker.
Standard UIView Only
To debug layout using Flipper, add the following pod:
Once you have added the pod, initialise the plugin and add it to the
FlipperClient as follows.
With ComponentKit Support
If you want to enable ComponentKit support in the layout inspector, you need to add
FlipperKit/FlipperKitLayoutComponentKitSupport to your Podfile.
Once you have added the pod you will then need to augment the descriptor with Componentkit-specific settings as shown below.