imageviewに対して「[Accessibility] Missing contentDescription attribute on image」という警告が表示されます。Android Lintの使用中
どういう意味ですか?
<string name="none"></string>  それから私は使用しましたandroid:contentDescription="@string/none"
                imageviewに対して「[Accessibility] Missing contentDescription attribute on image」という警告が表示されます。Android Lintの使用中
どういう意味ですか?
<string name="none"></string>  それから私は使用しましたandroid:contentDescription="@string/none"
                回答:
android:contentDescriptionImageViewの属性を設定することにより、この警告を解決しました
android:contentDescription="@string/desc"
ADT 16のAndroid Lintサポートはこの警告をスローして、画像ウィジェットがcontentDescriptionを提供するようにします。
これは、ビューの内容を簡単に説明するテキストを定義します。このプロパティは、主にアクセシビリティのために使用されます。一部のビューにはテキスト表現がないため、この属性を使用してこのような属性を提供できます。
ImageViewsやImageButtonsなどの非テキストウィジェットは、contentDescription属性を使用してウィジェットのテキスト説明を指定し、スクリーンリーダーやその他のユーザー補助ツールがユーザーインターフェイスを適切に説明できるようにする必要があります。
別のオプションは警告を個別に抑制することです:
xmlns:tools="http://schemas.android.com/tools"  (usually inserted automatically)
tools:ignore="contentDescription"
例:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" 
    tools:ignore="contentDescription" >
       <ImageView
            android:layout_width="50dp"
            android:layout_height="match_parent"
            android:adjustViewBounds="true"
            android:padding="5dp"
            android:src="@drawable/icon" />
              contentDescriptionを追加することをお勧めします。
android:contentDescription="@string/contentDescriptionXxxx"
しかし、現実的になりましょう。ほとんどの人はアクセシビリティのためにリテラルを維持しません。それでも、少しの努力で、障害を持つ人々を助ける何かを実装することができます。
<string name="contentDescriptionUseless">deco</string>
<string name="contentDescriptionAction">button de action</string>
<string name="contentDescriptionContent">image with data</string>
<string name="contentDescriptionUserContent">image from an other user</string>
。
視覚障害者が知っておくべき最も重要なことは、「続行するためにクリックする必要のあるボタンはどこにあるか」です。
クリック可能なものにはcontentDescriptionActionを使用します。
contentDescriptionContentを情報付きの画像に使用します(グラフ、textAsImage、...)
ユーザーが提供するすべてのコンテンツにはcontentDescriptionUserContentを使用します。
残りのコンテンツにはcontentDescriptionUselessを使用します。
これは単なる警告なので、抑制できます。XMLのグラフィカルレイアウトに移動して、次の操作を行います。
右上の赤いボタンをクリックします

「問題の種類を無効にする」を選択します(例)

この警告をエレガントな方法で抑制したい場合(この特定のImageViewにはアクセシビリティは必要ないことが確実なため)、特別な属性を使用できます。
android:importantForAccessibility="no"
              Gradleファイル(モジュールアプリ)に移動し、コードブロックの下に追加します
android {
    ... 
    lintOptions {
        disable 'ContentDescription'
    }
    ...
}
警告はもうありません!幸せなコーディング
非テキストウィジェットは、スクリーンリーダーがユーザーインターフェースを説明できるように、画像をテキストで説明するために、何らかの方法でコンテンツの説明を必要とします。プロパティを無視するか、プロパティを定義できますxmlns:tools="http://schemas.android.com/tools"
tools:ignore="contentDescription"android:contentDescription="your description"