【发布时间】:2013-10-08 19:00:39
【问题描述】:
我使用 ADT Eclipse 启动了一个基于主/详细流模板的新 Android 应用程序。该模板创建了两个活动,一个主片段和一个细节片段,以适应大小屏幕。
我注意到activity_item_list.xml 文件具有tools:layout 属性:
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_list"
android:name="com.example.fragmenttwopanel.ItemListFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
tools:context=".ItemListActivity"
tools:layout="@android:layout/list_content" />
我尝试删除该属性,应用程序以相同的方式运行,但在 ADT 的图形布局选项卡中,一条消息询问我:
从“片段布局”上下文菜单中选择预览布局
它的目的是什么?只是为了在图形布局中预览?
【问题讨论】:
-
更多关于工具命名空间的信息:stackoverflow.com/questions/11078487/…
标签: android xml android-layout graphical-layout-editor