6

AndroidでListPreferenceにcontentDescriptionを追加する方法。contentDescription はリストで使用する必要があります

私は私の好みのレイアウトListPreference wichがこのように見えることはほとんどありません

  <ListPreference
        android:entries="@array/entries"
        android:entryValues="@array/entryValues"
        android:key="keylist_1"
        android:title="@string/setting"
        android:layout="@layout/custom_checkbox_preference" />

それぞれ同じレイアウトを使用します。レイアウト custom_checkbox_preference は次のようになります。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <RelativeLayout
        android:layout_width="0dip"
        android:layout_height="wrap_content"
        android:layout_weight="1" >

        <TextView
            android:id="@+android:id/title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"            
            android:singleLine="true" />

        <TextView
            android:id="@+android:id/summary"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@android:id/title" />
    </RelativeLayout>

</LinearLayout>

タイトル contentDescription にアクセスする方法を追加する必要がありますか?

私は ListPreference に追加しようとしています:

        android:hint="@string/desc_setting"
        android:contentDescription="@string/desc_setting"

しかし、これはうまくいきません。これは、他の ListPreferences で使用されているため、タイトル テキストビューの custom_checkbox_preference にも追加できません。

4

0 に答える 0