添加测试效果工具tools

来源:互联网 发布:写谱子的软件 编辑:程序博客网 时间:2024/06/05 16:29

在写布局是我们要写一下测试数据上去看一下效果,但是运行时又不想让用户看到这些测试数据,就可以使用这个工具

tools:text="aaa"
例如:

<TextView    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:layout_centerInParent="true"    tools:text="测试文字"    android:textColor="@color/white"    android:textSize="18sp" />
另外,查看Listview或GridView效果是可以使用这个工具:

tools:listitem="@layout/item_list_layout"
例如:

<ListView    android:layout_width="match_parent"    android:layout_height="match_parent"    tools:listitem="@layout/item_list_layout" />


1 0
原创粉丝点击