Android Studio预览片段 [英] Android Studio preview fragment

查看:74
本文介绍了Android Studio预览片段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下布局文件:

<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? 就像我们在将< fragment> 标签与 tools:layout 属性一起使用时所做的一样?

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 ?

推荐答案

虽然有用,但当前的工具文档表明这是可能的.

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

这篇关于Android Studio预览片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆