Android Tools Attributes使用

地址:https://developer.android.google.cn/studio/write/tool-attributes

<android.support.v7.widget.RecyclerView
    android:id="@+id/recyclerView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:itemCount="3"/>
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@android:id/list"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:listitem="@layout/sample_list_item"
    tools:listheader="@layout/sample_list_header"
    tools:listfooter="@layout/sample_list_footer" />

For example, if the android:text attribute value is set at runtime or you want to see the layout with a value different than the default, you can add tools:text to specify some text for the layout preview only.

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Correctness AdapterViewChildren Summary: AdapterViews can...
    MarcusMa阅读 8,925评论 0 6
  • mean to add the formatted="false" attribute?.[ 46% 47325/...
    ProZoom阅读 2,725评论 0 3
  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    wgl0419阅读 6,359评论 1 9
  • 今天注册了简书,有点欣欣然,似那只青娃跳出来突然看到了外面的世界那般……
    问星星阅读 155评论 3 1
  • 今天偶尔看了5月7号演员高圆圆在《南京,南京》中的采访,说到一个词,那就是安全感。 原文如下:“可能因为我是天秤座...
    王红春不雨棠梨阅读 265评论 0 0