命名空间布局的XML

命名空间布局的XML

本文介绍了Android和QUOT;工具和QUOT;命名空间布局的XML文档中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

%的问题在这里,

What's "工具:背景与QUOT; Android中布局文件?

工具命名空间参考号(xmlns:工具=htt​​p://schemas.android.com/tool​​s)已经开始最近出现在我的布局,我想知道更多。原帖仅描述的'工具:上下文属性,但我也注意到的使用工具:列表项属性出现的时候我已经指定一个ListView一个preVIEW版面项目,即

The 'tools' namespace reference (xmlns:tools="http://schemas.android.com/tools") has begun to appear in my layouts recently, and I want to know more. The original post only described the 'tools:context' attribute, but I have also noticed usage of the "tools:listitem" attribute appearing when I have designated a preview layout item for a listview, i.e.

<ListView
    android:id="@+id/lvCustomer"
    tools:listitem="@layout/customer_list_item" >
</ListView>

有没有更多的元素?

Are there more elements?

我来到这个'工具'命名空间是,我希望能够有'preVIEW只文本(即一个TextView或EditText上)使用Eclipse中的布局设计时。

What brought me to this 'tools' namespace is that I want to be able to have 'preview-only' text (i.e. in a TextView or EditText) when using the layout designer in eclipse.

目前,我安排我的布局时,指定文本或提示属性previewing文字...但我总是要记住从$ C $内清除preVIEW价值角

Currently, I assign the 'text' or 'hint' property for previewing text when arranging my layouts... but then I always have to remember to clear the preview value from within the code.

在理想情况下,而不是

<string name="preview_customer_name">Billy Bob's Roadhouse Pub</string>

...

<TextView
    android:id="@+id/tvCustomerName"
    android:text="@string/preview_customer_name"
</TextView>

有一个是这样的:

have a something like:

<TextView
    android:id="@+id/tvCustomerName"
    tools:previewText="@string/preview_customer_name"
</TextView>

谢谢 -

推荐答案

有关designtime我们刚刚增加了支持属性,像这样的Andr​​oid Studio中0.2.11。见http://tools.android.com/tips/layout-designtime-attributes更多。

We've just added support for designtime attributes like this in Android Studio 0.2.11. See http://tools.android.com/tips/layout-designtime-attributes for more.

这篇关于Android和QUOT;工具和QUOT;命名空间布局的XML文档中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 02:26