با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
بازرسی کنید
چندین ابزار می توانند به شما در بررسی سریع محتوای خود از نقطه نظر دسترسی کمک کنند:
مجموعه دسترسپذیری Android : شامل منوی دسترسپذیری، انتخاب برای گفتن، دسترسی سوئیچ و TalkBack است که بینشی درباره نحوه عملکرد معنایی برنامه شما برای کاربران این فناوریها ارائه میدهد. آزمایش با فناوریهای کمکی Android بهعنوان بهترین راه برای درک آنچه کاربران با نیازهای دسترسی شما تجربه خواهند کرد، بسیار توصیه میشود.
Layout Inspector : به شما امکان می دهد معنای هر یک از اجزای قابل ترکیب را بررسی و اشکال زدایی کنید و به شناسایی هرگونه اطلاعات گم شده یا نادرست کمک می کند.
برنامه Accessibility Scanner : صفحه نمایش شما را اسکن می کند و با شناسایی برخی از مشکلات رایج، پیشنهاداتی برای بهبود دسترسی به آن ارائه می دهد.
اشکال زدایی
بین Compose، سیستم معناشناسی و سرویسهای دسترسی Android، ممکن است با رفتارهای غیرمنتظره دسترسی مواجه شوید که ردیابی آنها دشوار است. ویژگیهای معنایی میتواند به شما کمک کند تا بفهمید چرا اجزای شما به همان شکلی که هستند رفتار میکنند.
میتوانید مشکلات رفتار دسترسی را با Layout Inspector در Android Studio، TreeDebug در تنظیمات برنامهنویس TalkBack یا printToLogComposeTestRule اشکالزدایی کنید. همه این ابزارها میتوانند اطلاعاتی در مورد گرهها (و ویژگیهای آنها) که توسط Compose در معرض خدمات دسترسپذیری قرار میگیرند، ارائه دهند.
مثال زیر از Layout Inspector برای اشکالزدایی صفحهای با سه عنصر استفاده میکند که در آن، با روشن بودن سرویسهای دسترسپذیری، اولین مورد انتخاب نشده است، و دومی هیچ بازخورد عملی مرتبط با آن ندارد. برای یافتن مسائل بالقوه می توانید ویژگی های معنایی را بررسی کنید.
درخت کامپوننت در Layout Inspector حاوی اطلاعاتی درباره مرزهای یک عنصر، پارامترها و سایر اطلاعات معنایی مرتبط با آن است. در درخت، هر سه عنصر شناسایی می شوند:
شکل 2. Layout Inspector با هر سه عنصر..
اولین عنصر دارای ویژگی hideFromAccessibility است. این نشان میدهد که ممکن است عنصر در جایی در درخت معناشناسی پنهان شده باشد، یا با پوشش تزئینی پنهان شده باشد.
شکل 3. Layout Inspector: اولین عنصر با hideFromAccessibility .
عنصر دوم دارای ویژگی فوکوس است، اما مانند عنصر قبلی onClick ندارد. بنابراین، ممکن است یک اصلاحکننده clickable در جایی وجود نداشته باشد، به همین دلیل است که سرویس دسترسی مانند TalkBack ممکن است سیگنال عملی را به کاربر اعلام نکند:
شکل 4. Layout Inspector: عنصر دوم با focused .
سومین عنصر متنی دارای تمام ویژگیهای لازم است – قابل تمرکز است، دارای onClick است، و سایر معناییهای اضافی اعمال میشود – به همین دلیل است که همانطور که انتظار میرود تفسیر میشود.
شکل 5. Layout Inspector: عنصر سوم با تمام APIها.
به این ترتیب، میتوانید از ابزارهای اشکالزدایی برای بررسی اینکه چرا اعلانها یا انتخابهای خاص توسط سرویسهای دسترسپذیری انجام نمیشوند، استفاده کنید.
{% کلمه به کلمه %} {% آخر کلمه %}
برای شما توصیه می شود
توجه: وقتی جاوا اسکریپت خاموش است، متن پیوند نمایش داده می شود
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و 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,["# Inspect and debug\n\nInspect\n-------\n\nSeveral tools can help you quickly inspect your content from an accessibility\npoint of view:\n\n- [Android Accessibility Suite](https://play.google.com/store/apps/details?id=com.google.android.marvin.talkback): Includes Accessibility Menu, Select to Speak, Switch Access, and TalkBack, which provide insight into how your app's semantics work for users of these technologies. Testing with Android's assistive technologies is highly recommended as the best way to understand what your users with accessibility needs will experience.\n- [Layout Inspector](/develop/ui/compose/tooling/debug#layout_inspector): Lets you inspect and debug semantics of each composable, and helps identify any missing or incorrect information.\n- [Accessibility Scanner](https://support.google.com/accessibility/android/answer/6376570) app: Scans your screen and provides suggestions to improve its accessibility by identifying some common pitfalls.\n\nDebug\n-----\n\nBetween Compose, the semantics system, and Android accessibility services, you\nmight run into unexpected accessibility behaviors that are difficult to trace.\nSemantic properties can help you understand why your components are behaving\nthe way that they are.\n\nYou can debug accessibility behavior issues with the [Layout Inspector](/develop/ui/compose/tooling/debug#layout_inspector) in\nAndroid Studio, TreeDebug in TalkBack developer settings, or `ComposeTestRule`'s\n[`printToLog`](/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.SemanticsNodeInteraction).printToLog(kotlin.String,kotlin.Int)). All of these tools can provide information about nodes\n(and their properties) that are exposed to accessibility services by Compose.\n\nThe following example uses Layout Inspector to debug a screen with three\nelements where, with accessibility services on, the first one isn't being\nselected, and the second one doesn't have any action feedback associated with\nit. You can examine the semantic properties to find potential issues.\n\nThe component tree in Layout Inspector contains information about an element's\nbounds, parameters, and other semantic information associated with it. In the\ntree, all three elements are recognized:\n**Figure 2.** Layout Inspector with all three elements..\n\nThe first element has the `hideFromAccessibility` property applied. This\nindicates that the element may be marked as hidden somewhere in the semantics\ntree, or it is obscured by some decorative overlay.\n**Figure 3.** Layout Inspector: first element with `hideFromAccessibility`.\n\nThe second element has a focus property, but no `onClick` like the previous\nelement. Therefore, it might be missing a `clickable` modifier somewhere, which\nis why an accessibility service like TalkBack may not be announcing some\naction signal to the user:\n**Figure 4.** Layout Inspector: second element with `focused`.\n\nThe third text element has all the necessary properties---it is focusable, has\nan `onClick`, and other additional semantics applied---which is why it's\ninterpreted as expected.\n**Figure 5.** Layout Inspector: third element with all APIs.\n\nIn this way, you can use debugging tools to investigate why certain\nannouncements or selections aren't performed by accessibility services.\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [Accessibility in Compose](/develop/ui/compose/tooling/debug#layout_inspector)\n- \\[Material Design 2 in Compose\\]\\[19\\]\n- [Testing your Compose layout](https://support.google.com/accessibility/android/answer/6376570)"]]