我找不到tools属性以在 Android 布局中设置示例图像。我的假设是目前没有这样的事情,至少没有direct支持。
但我想知道是否我搜索得不够好或者是否有解决方法。
如何在 Android 设计时定义图像占位符tools?
的例子toolsTextView 的属性(即工具:文本文本属性):
<TextView
android:id="@+id/tv_vote_average"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textStyle="bold"
tools:text="8.4/10"/>
这很简单,就像TextView
。只需使用tools:src
设置图像。
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:src="@drawable/placeholder" />
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)