我在ImageView
了這一警告之前‘’[Accessibility] Missing contentDescription attribute on image
「然後我加入這個代碼到它:在包中發現的屬性'contentDescription「機器人沒有資源標識符
android:contentDescription="@string/desc"
,現在我面臨錯誤
No resource identifier found for attribute 'contentDescription' in package 'android
這是我的代碼:
<ImageView
android:id="@+id/handle"
android:layout_width="48dip"
android:layout_height="48dip"
android:contentDescription="@string/desc"
android:src="@drawable/icon"
/>
不是錯誤的答案,但可以保存忽略警告。雖然它可能是一個很好的做法,也可以添加說明,但沒有它們就可以正常工作:) – Nanne 2012-01-15 11:03:41
我很困惑,因爲在第一個地方我只有幾個警告,沒有錯誤,但我無法運行應用程序,我不知道爲什麼! – user1143529 2012-01-16 15:56:21