当滑动时,似乎有一个TalkBack发言顺序问题,通过包含添加了布局。
我有以下布局(注意最后一个包含元素):
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/faqTitle"
style="@style/pearsonHeadingStyleWithBackground"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:layout_alignParentTop="true"
android:contentDescription="@string/frequently_asked_question"
android:text="@string/faq"/>
<WebView
android:id="@+id/faqWebView"
android:layout_width="match_parent"
android:layout_below="@+id/faqTitle"
android:layout_above="@+id/faqDetailTwoButtonPanel"
android:layout_height="match_parent" />
<include layout="@layout/include_two_button_bottom_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:id="@+id/faqDetailTwoButtonPanel" />
</RelativeLayout>
以下是include的XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/bottomTwoButtonPanel"
style="@style/pearsonBottomButtonPanelStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:padding="5dp"
android:orientation="horizontal"
tools:showIn="@layout/frag_faq_content">
<TextView
android:id="@+id/bottomTwoButtonPanelTitleText"
style="@style/pearsonBottomButtonPanelTitleStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:textStyle="bold"
android:layout_alignParentTop="true"
android:text="@string/faq_feedback_msg"
android:contentDescription="@string/faq_feedback_msg_accessability"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_below="@+id/bottomTwoButtonPanelTitleText"
android:layout_height="wrap_content" android:layout_centerInParent="true">
<Button
android:id="@+id/bottomTwoButtonPanelNegativeButton"
style="@style/onBoardingTwoButtonStyle"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight=".5"
android:layout_margin="@dimen/pss_gutter_padding"
android:text="@string/no"/>
<Button
android:id="@+id/bottomTwoButtonPanelPositiveButton"
style="@style/onBoardingTwoButtonStyle"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight=".5"
android:layout_gravity="center_vertical"
android:layout_margin="@dimen/pss_gutter_padding"
android:text="@string/yes" />
</LinearLayout>
</RelativeLayout>
2016年5月10日更新 - 在
下查看层次结构转储<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<hierarchy rotation="0">
<node index="0" text="" resource-id="" class="android.widget.FrameLayout" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,0][1440,2392]">
<node index="0" text="" resource-id="" class="android.widget.FrameLayout" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,0][1440,2392]">
<node index="0" text="" resource-id="" class="android.widget.LinearLayout" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,0][1440,2392]">
<node index="0" text="" resource-id="" class="android.widget.FrameLayout" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,88][1440,2392]">
<node index="0" text="" resource-id="com.powerschool.portal:id/decor_content_parent" class="android.view.View" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,88][1440,2392]">
<node index="0" text="" resource-id="com.powerschool.portal:id/action_bar_container" class="android.widget.FrameLayout" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,88][1440,284]">
<node index="0" text="" resource-id="com.powerschool.portal:id/action_bar" class="android.view.View" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,88][1440,284]">
<node index="0" text="PowerSchool" resource-id="" class="android.widget.TextView" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[56,139][472,232]" />
</node>
</node>
<node index="1" text="" resource-id="android:id/content" class="android.widget.FrameLayout" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,284][1440,2392]">
<node index="0" text="" resource-id="" class="android.widget.LinearLayout" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,284][1440,2392]">
<node index="0" text="" resource-id="com.powerschool.portal:id/onBoardingFragmentPlaceholder" class="android.widget.LinearLayout" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,284][1440,2392]">
<node index="0" text="" resource-id="" class="android.widget.RelativeLayout" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,284][1440,2392]">
<node index="0" text="FAQ" resource-id="com.powerschool.portal:id/faqTitle" class="android.widget.TextView" package="com.powerschool.portal" content-desc="Frequently Asked Question" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,284][1440,457]" />
<node index="1" text="" resource-id="" class="android.webkit.WebView" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,457][1440,2078]">
<node index="0" text="" resource-id="" class="android.webkit.WebView" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="true" focused="true" scrollable="true" long-clickable="false" password="false" selected="false" bounds="[0,457][1440,2078]">
<node index="0" text="" resource-id="" class="android.view.View" package="com.powerschool.portal" content-desc="Why am I not receiving push notifications on the PowerSchool Mobile app?" checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[45,502][1396,649]" />
<node index="1" text="" resource-id="" class="android.view.View" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[45,712][1396,1668]">
<node index="0" text="" resource-id="" class="android.view.View" package="com.powerschool.portal" content-desc="Your school's PowerSchool server must be on PowerSchool 9.1 (Mobile API 2.2.1) or greater." checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[45,712][1344,859]" />
<node index="1" text="" resource-id="" class="android.view.View" package="com.powerschool.portal" content-desc=" " checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,457][0,457]" />
<node index="2" text="" resource-id="" class="android.view.View" package="com.powerschool.portal" content-desc=" " checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,457][0,457]" />
<node index="3" text="" resource-id="" class="android.view.View" package="com.powerschool.portal" content-desc="Note" checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[45,933][182,1006]" />
<node index="4" text="" resource-id="" class="android.view.View" package="com.powerschool.portal" content-desc=": An issue was discovered in PowerSchool (v9.0 - v9.0.2, API version 2.2.0) that would push incorrect grades and attendance notifications to mobile devices in some circumstances. This issue is now resolved and is included in PowerSchool 9.1." checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[45,933][1393,1374]" />
<node index="5" text="" resource-id="" class="android.view.View" package="com.powerschool.portal" content-desc=" " checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,457][0,457]" />
<node index="6" text="" resource-id="" class="android.view.View" package="com.powerschool.portal" content-desc=" " checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,457][0,457]" />
<node index="7" text="" resource-id="" class="android.view.View" package="com.powerschool.portal" content-desc="For additional help, see " checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[45,1447][707,1521]" />
<node index="8" text="" resource-id="" class="android.view.View" package="com.powerschool.portal" content-desc="How do I find what mobile API version my school's PowerSchool server is running?" checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[45,1447][1319,1668]" />
<node index="9" text="" resource-id="" class="android.view.View" package="com.powerschool.portal" content-desc=" FAQ." checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[549,1594][707,1668]" />
</node>
</node>
</node>
<node index="2" text="" resource-id="com.powerschool.portal:id/faqDetailTwoButtonPanel" class="android.widget.RelativeLayout" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,2078][1440,2392]">
<node index="0" text="Did this FAQ answer your question?" resource-id="com.powerschool.portal:id/bottomTwoButtonPanelTitleText" class="android.widget.TextView" package="com.powerschool.portal" content-desc="Did this F.A.Q. answer your question?" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[18,2096][1422,2198]" />
<node index="1" text="" resource-id="" class="android.widget.LinearLayout" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[18,2198][1422,2374]">
<node index="0" text="No" resource-id="com.powerschool.portal:id/bottomTwoButtonPanelNegativeButton" class="android.widget.Button" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[36,2216][702,2356]" />
<node index="1" text="Yes" resource-id="com.powerschool.portal:id/bottomTwoButtonPanelPositiveButton" class="android.widget.Button" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[738,2216][1404,2356]" />
</node>
</node>
</node>
</node>
</node>
</node>
</node>
</node>
</node>
<node index="1" text="" resource-id="" class="android.widget.FrameLayout" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,0][1440,88]" />
</node>
<node index="1" text="" resource-id="android:id/statusBarBackground" class="android.view.View" package="com.powerschool.portal" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,0][1440,88]" />
</node>
</hierarchy>
2016年5月10日更新 - 操作系统,设备和TalkBack版本:
启用TalkBack 4.5.0.1后,当屏幕加载时,当我浏览每个视图时,语音顺序为:屏幕标题和每个操作栏元素&gt; faqTitle &gt;的 faqWebView
bottomTwoButtonPanel (通过include添加的布局)被跳过。获得它的唯一方法是导航到屏幕标题,然后向相反方向滑动。
我已尝试在包含的相对布局中设置android:focusable="true"
,但这对语音顺序没有影响。另外,我了解Focus Handling在这种情况下不适用。