【问题标题】:Android Studio preview fragmentAndroid Studio 预览片段
【发布时间】:2013-10-25 09:58:36
【问题描述】:

我有以下布局文件:

<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 将包含一个动态添加的fragment,有没有办法在编辑器中预览fragment? 就像我们在使用带有 tools:layout 属性的 标签时可以做的那样?

【问题讨论】:

  • 接受的答案是重定向 ot 文档。我查看了工具文档,但没有看到答案。你能发布确切的解决方案吗?

标签: android android-studio


【解决方案1】:

虽然它很有用,但 the current tools docs 中没有任何内容表明这是可能的。

【讨论】:

猜你喜欢
  • 2014-10-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-08-27
  • 1970-01-01
  • 2023-03-12
  • 1970-01-01
  • 2015-11-10
相关资源
最近更新 更多