Effectively use layout editor on layouts with non-stationary fragments

Thanks to all the features of the Android development tools, especially since version 21, the graphical layout editor is a powerful tool for visual control over the layout with fragments for each configuration and locale. I know that a typical Activity XML format will contain static fragment tags with information embedded in the layout editor, for example tools:layout="@layout/book_collection_view_window_list" .

However, since I need to dynamically replace Fragments in my window, I cannot use static fragment tags and should instead provide containers such as FrameLayout , which I can access in replace() . Is there something like tools:layout or tools:context that I can use in this container, so there is more to the layout editor than just a black void, and so I can use the design and validation functions that it would give me?

+6
source share
1 answer

According to the documentation for FrameLayout , there seems to be an attribute that can be used in the FrameLayout tag to place a drop-down in the foreground of a ViewGroup.

You can use this to see FrameLayout while you customize your view. I often just add color so I can see where it is relative to the background and other View s.

+2
source

All Articles