如何为每个导航抽屉项目添加内容描述功能

时间:2018-12-24 09:53:14

标签: android talkback android-accessibility

我正在开发一个新的应用程序,我已经使用了导航抽屉,当用户按下导航项时,我曾尝试过使用contentDescription功能,但是我没有从Google找到任何信息来实现它。

在menu_item.xml中的代码下面

<?xml version="1.0" encoding="utf-8"?>
<menu>
    <item
        icon="@drawable/ic_menu_home"
        title="@string/item_menu_home" />
    <item
        icon="@drawable/ic_menu_session"
        title="@string/item_menu_session" />
    <item
        icon="@drawable/ic_icon_menu_pain_profile_man"
        textColor="@color/menuLightGreen"
        title="@string/item_menu_pain_profile" />
    <item
        icon="@drawable/ic_menu_progress"
        textColor="@color/menuLightGreen"

        title="@string/item_menu_progress_prognosis" />
    <item
        icon="@drawable/ic_menu_schedule"
        textColor="@color/menuLightGreen"
        title="@string/item_menu_schedule_reminders" />
    <item
        icon="@drawable/ic_menu_therapy_info"
        textColor="@color/menuLightGreen"
        title="@string/therapy_information" />
    <item
        icon="@drawable/ic_menu_activity"
        textColor="@color/menuLightGreen"
        title="@string/activity_journal" />
    <item
        icon="@drawable/ic_menu_favourite"
        textColor="@color/menuLightRose"
        title="@string/item_menu_favourite" />
    <item
        icon="@drawable/ic_menu_chat"
        title="@string/support_feedback" />
    <item
        icon="@drawable/ic_menu_therapy"
        title="@string/item_menu_therapy_settings" />
    <item
        icon="@drawable/ic_menu_account"
        title="@string/item_menu_account" />
    <item
        icon="@drawable/ic_menu_privacy_policy"
        title="@string/privacy_policy_title" />
    <item
        icon="@drawable/ic_menu_about_healo"
        textColor="@color/menuLightGreen"
        title="@string/about_healo" />

    <item
        icon="@drawable/ic_menu_privacy_policy"
        title="@string/subscriptions" />

    <item
        icon="@drawable/ic_icon_signout"
        textColor="@color/menuGrey"
        title="@string/sign_out" />

0 个答案:

没有答案