What is android:contentDescription=quot;@string/descquot; in ImageView#39;s xml?(android:contentDescription=quot;@string/descquot;在ImageView的XML中是什么?)
问题描述
我在GraphicalLayout
中添加了imageView
,但它在我的实际设备上与在AVD上看起来不同。
我发现需要在布局中添加contentDescription
.xml
,但是添加时:contentDescription="@string/desc"
出现错误:
"找不到与给定名称匹配的资源(位于‘contentDescription’,值为‘@string/desc’)"
字符串"desc"是什么?它应该是什么样子?
推荐答案
您需要将其添加到string.xml
文件中:
<string name="desc">your desc goes here</string>
虽然我不知道您为什么需要在imageView中添加contentDescription
来解决外观不一致的问题!我认为这解决不了问题。
这篇关于android:contentDescription=";@string/desc";在ImageView的XML中是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!