4

i have the following layout file:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:layout_height="match_parent">

    <TextView
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:text="@string/what_did_you_eat"/>

    <FrameLayout
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        tools:context=".AddFoodActivity"
        tools:ignore="MergeRootFrame"
        />

</LinearLayout>

FrameLayout will contain a dynamic added fragment, is there a way to preview in the editor the fragment ? Like we can do when using a <fragment> tag with the tools:layout attribute ?

Jitesh Dalsaniya
  • 1,917
  • 3
  • 20
  • 36
forcewill
  • 1,637
  • 2
  • 16
  • 31
  • In acepted answer is redirect ot docs. I looked to tools docs but I don't see the aswer. Can you post exact solution? – LunaVulpo Feb 20 '17 at 11:21

1 Answers1

4

While it would be useful, there's nothing in the current tools docs that suggests this is possible.

blahdiblah
  • 33,069
  • 21
  • 98
  • 152
  • 2
    You can nest `fragment` tag under the `FrameLayout` just like described here in the Layout chapter https://developer.android.com/reference/android/app/Fragment.html it will work – fo2rist Dec 27 '16 at 18:33