با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
سعی کنید برنامه Android خود را برای همه، از جمله افرادی که نیازهای دسترسی دارند، قابل استفاده کنید.
افرادی که دچار اختلال بینایی، کوررنگی، اختلال شنوایی، نقص در مهارت، ناتوانی های شناختی و بسیاری از ناتوانی های دیگر هستند از دستگاه های اندرویدی استفاده می کنند. وقتی برنامه هایی را با در نظر گرفتن قابلیت دسترسی توسعه می دهید، تجربه کاربری را برای افرادی که نیازهای دسترسی دارند بهتر می کنید.
این صفحه دستورالعملهایی را برای اجرای عناصر کلیدی دسترسی ارائه میکند تا همه بتوانند راحتتر از برنامه شما استفاده کنند. برای راهنمایی عمیق تر در مورد نحوه دسترسی بیشتر به برنامه خود، به اصول بهبود دسترسی به برنامه مراجعه کنید.
افزایش دید متن
برای هر مجموعه ای از متن در برنامه شما، توصیه می کنیم کنتراست رنگ - یا تفاوت در روشنایی درک شده بین رنگ متن و رنگ پس زمینه پشت متن - بالاتر از یک آستانه خاص باشد. آستانه دقیق به اندازه فونت متن و اینکه آیا متن به صورت پررنگ ظاهر می شود بستگی دارد:
اگر متن کوچکتر از 18pt است، یا اگر متن پررنگ و کوچکتر از 14pt است، نسبت کنتراست رنگ را حداقل روی 4.5:1 تنظیم کنید.
برای تمام متن های دیگر، نسبت کنتراست رنگ را حداقل روی 3:1 تنظیم کنید.
تصویر زیر دو نمونه از کنتراست رنگ متن به پسزمینه را نشان میدهد:
شکل 1. کنتراست رنگ کمتر از حد توصیه شده (چپ) و کافی (راست).
برای بررسی کنتراست رنگ متن به پسزمینه در برنامهتان، از یک بررسیکننده کنتراست رنگ آنلاین یا برنامه Accessibility Scanner استفاده کنید.
از کنترل های بزرگ و ساده استفاده کنید
اگر مشاهده و ضربه زدن روی کنترلهای آن آسانتر باشد، استفاده از UI برنامه شما آسانتر است. توصیه میکنیم هر عنصر رابط کاربری تعاملی دارای یک ناحیه قابل تمرکز یا اندازه هدف لمسی با حداقل 48dpx48dp باشد. بزرگتر حتی بهتر است.
برای اینکه یک عنصر UI معین دارای اندازه هدف لمسی به اندازه کافی بزرگ باشد، شرایط زیر باید هر دو صادق باشند:
برای هر عنصر رابط کاربری در برنامه خود، توضیحی را اضافه کنید که هدف آن عنصر را توضیح دهد. در بیشتر موارد، همانطور که در قطعه کد زیر نشان داده شده است، این توضیحات را در ویژگی contentDescription عنصر قرار می دهید:
هنگام افزودن توضیحات به عناصر رابط کاربری برنامه خود، بهترین شیوه های زیر را در نظر داشته باشید:
نوع عنصر رابط کاربری را در توضیحات محتوا درج نکنید. صفحه خوان ها به طور خودکار هم نوع و هم توضیحات عنصر را اعلام می کنند. برای مثال، اگر انتخاب یک دکمه باعث میشود که یک عمل «ارسال» در برنامه شما انجام شود، توضیح دکمه را "Submit" کنید، نه "Submit button" .
هر توصیف باید منحصر به فرد باشد. به این ترتیب، هنگامی که کاربران صفحهخوان با توضیحات مکرر عنصر مواجه میشوند، به درستی تشخیص میدهند که تمرکز روی عنصری است که قبلاً فوکوس داشته است. به طور خاص، هر آیتم در یک گروه view مانند RecyclerView باید توضیحات متفاوتی داشته باشد. هر توضیحی باید محتوایی را نشان دهد که برای یک مورد خاص منحصر به فرد است، مانند نام یک شهر در لیستی از مکانها.
اگر minSdkVersion برنامه شما 16 یا بالاتر است، میتوانید ویژگی android:importantForAccessibility را برای عناصر گرافیکی که فقط برای جلوههای تزئینی استفاده میشوند، روی "no" تنظیم کنید.
منابع اضافی
برای کسب اطلاعات بیشتر در مورد دسترسی بیشتر برنامه خود، به منابع اضافی زیر مراجعه کنید:
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Make apps more accessible\n\nTry to make your Android app usable for everyone, including people with\naccessibility needs.\n\nPeople with impaired vision, color blindness, impaired hearing, impaired\ndexterity, cognitive disabilities, and many other disabilities use Android\ndevices. When you develop apps with\naccessibility in mind, you make the user experience better for people with\naccessibility needs.\n\nThis page presents guidelines for implementing key elements of accessibility\nso that everyone can use your app more easily. For more in-depth guidance on\nhow to make your app more accessible, see [Principles for improving app\naccessibility](/guide/topics/ui/accessibility/principles).\n\nIncrease text visibility\n------------------------\n\nFor each set of text within your app, we recommend the *color contrast*---or\ndifference in perceived brightness between the color of the text and the color\nof the background behind the text---to be above a specific threshold. The\nexact threshold depends on the text's font size and whether the text appears in\nbold:\n\n- If the text is smaller than 18pt, or if the text is bold and smaller than 14pt, set the color contrast ratio to at least 4.5:1.\n- For all other text, set the color contrast ratio to at least 3:1.\n\nThe following image shows two examples of text-to-background color contrast: \n**Figure 1.** Lower than recommended (left) and sufficient (right) color contrast.\n\nTo check the text-to-background color contrast in your app, use an online color\ncontrast checker or the [Accessibility\nScanner](https://play.google.com/store/apps/details?id=com.google.android.apps.accessibility.auditor)\napp.\n\nUse large, simple controls\n--------------------------\n\nYour app's UI is easier to use if its controls are easier to see\nand tap. We recommend that each interactive UI element have a focusable area, or\n*touch target size*, of at least 48dpx48dp. Larger is even better.\n\nFor a given UI element to have a large enough touch target size, the following\nconditions should **both** be true:\n\n- The sum of the values of [`android:paddingLeft`](/reference/android/view/View#attr_android:paddingLeft), [`android:minWidth`](/reference/android/view/View#attr_android:minWidth), and [`android:paddingRight`](/reference/android/view/View#attr_android:paddingRight) is greater than or equal to 48dp.\n- The sum of the values of [`android:paddingTop`](/reference/android/view/View#attr_android:paddingTop), [`android:minHeight`](/reference/android/view/View#attr_android:minHeight), and [`android:paddingBottom`](/reference/android/view/View#attr_android:paddingBottom) is greater than or equal to 48dp.\n\nThe padding values allow an object's *visible* size to be less than 48dpx48dp\nwhile still having the recommended touch target size.\n\nThe following code snippet shows an element that has the recommended touch\ntarget size: \n\n```xml\n\u003cImageButton ...\n android:paddingLeft=\"4dp\"\n android:minWidth=\"40dp\"\n android:paddingRight=\"4dp\"\n\n android:paddingTop=\"8dp\"\n android:minHeight=\"32dp\"\n android:paddingBottom=\"8dp\" /\u003e\n```\n\nDescribe each UI element\n------------------------\n\nFor each UI element in your app, include a description that\ndescribes the element's purpose. In most cases, you include this description in\nthe element's `contentDescription` attribute, as shown in the following code\nsnippet: \n\n```xml\n\u003c!-- Use string resources for easier localization. --\u003e\n\u003c!-- The en-US value for the following string is \"Inspect\". --\u003e\n\u003cImageView\n ...\n android:contentDescription=\"@string/inspect\" /\u003e\n```\n| **Note:** Don't provide descriptions for [`TextView`](/reference/android/widget/TextView) elements. Android accessibility services automatically announce the text itself as the description.\n\nWhen adding descriptions to your app's UI elements, keep the following best\npractices in mind:\n\n- Don't include the type of UI element in the content description. Screen\n readers automatically announce both the element's type and description. For\n example, if selecting a button causes a \"submit\" action to occur in your app,\n make the button's description `\"Submit\"`, not `\"Submit button\"`.\n\n- Each description must be unique. That way, when screen reader users\n encounter a repeated element description, they correctly recognize that the\n focus is on an element that already had focus earlier. In particular, each item\n within a view group such as\n [`RecyclerView`](/reference/androidx/recyclerview/widget/RecyclerView) must have\n a different description. Each description must reflect the content that's unique\n to a given item, such as the name of a city in a list of locations.\n\n- If your app's `minSdkVersion` is `16` or higher, you can set the\n [`android:importantForAccessibility`](/reference/android/view/View#attr_android:importantForAccessibility)\n attribute to `\"no\"` for graphical elements that are only used for decorative\n effect.\n\nAdditional resources\n--------------------\n\nTo learn more about making your app more accessible, see the following\nadditional resources:\n\n### Codelabs\n\n- [Starting Android\n Accessibility](https://codelabs.developers.google.com/codelabs/starting-android-accessibility)\n\n### Blog posts\n\n- [Accessibility: Are You Serving All Your\n Users?](https://android-developers.googleblog.com/2012/04/accessibility-are-you-serving-all-your.html)"]]