我想禁用此警告:圖像如何使用lintOptions禁用gradle中的'contentDescription'警告?
[輔助功能]缺少 'contentDescription' 屬性我知道解決的辦法
android:contentDescription:"@null"
。但我希望能夠完成整個項目,而不是每個ImageView。在documentation of tools android,他們主張做這樣的:
android { lintOptions { disable 'TypographyFractions','TypographyQuotes' ... } }
我的問題是什麼是對這樣的警告「contentDescription屬性上的圖像」 lint選項的名字嗎?
編輯,我的解決方案:
點擊禁止與@SuppressLint(爪哇)或工具:忽略(XML)
此按鈕添加此您
<ImageView .. />
:tools:ignore="ContentDescription"
所以,你只需要在你的
build.gradle
添加此lintOptions:android { lintOptions { disable 'ContentDescription' } }
你試過ALT +「不要再顯示警告」輸入? – XxGoliathusxX