【发布时间】:2014-01-04 10:06:05
【问题描述】:
背景
Google 添加了很好的“Designtime Attributes”(从here 找到它)仅用于 UI 设计器模式,因此,例如,如果您希望在 textView(或 EditText)上显示文本就在那里(以帮助您了解它的外观),您只需添加:
<EditText
tools:text="John Doe"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
来自 Google 的示例:
事实上,这应该适用于您已经可以使用的任何属性。不确定是否有任何限制,但它非常酷。
问题
现在,当我在 Eclipse 中执行此操作(只是一个带有“tools:text”属性的简单 textView)以及最新的 ADT 和 SDK (22.3.0.v201310242005-887826) 时,它只是不起作用。它只是没有做任何事情。
问题
此功能是否可能仅适用于新的 IDE (android studio)?如果有,怎么可能? Google 不应该也将每个 android-development 功能添加到 ADT 中吗?
另外,为什么在某些网站上它被称为“Designtime Layout Attributes”,而在某些网站上它只是“Designtime Attributes”?
【问题讨论】:
标签: android eclipse adt gui-designer designtime-attributes