[英]Android Studio preview fragment
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
? FrameLayout
将包含一个动态添加的fragment
,是否可以在编辑器中预览该fragment
? Like we can do when using a <fragment> tag with the tools:layout
attribute ? 就像我们在将<fragment>标记与
tools:layout
属性一起使用时所做的一样?
尽管这很有用,但当前的工具文档中没有任何东西表明这是可能的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.