添加测试效果工具tools

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

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"
 />


猜你喜欢

转载自blog.csdn.net/wangwenbo1019/article/details/68939856
今日推荐