4

2つのUITableViewControllersがあるメインウィンドウがあります。最初のtableViewController(左側のペイン)でセルを選択すると、右側のtableViewContainerにデータが入力されます。ボイスオーバーモードでは、最初のtableViewControllerのセルが選択されたときに、secondViewControllerの最初のセルにフォーカスが移り、そこからフリック順序が開始されるようにします。私はすでに次の2つのアプローチを試したことに注意してください。

1)2番目のViewControllerの最初のセルであるfirstResponderを作成します。

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{          
    UITableViewCell *outCell =(UITableCellView*)  [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
    if (indexPath.row == 0)
    {
        [outCell becomeFirstResponder];
    }
}

2)セルを最初のアクセシビリティ項目として、レイアウト変更通知を投稿してみました。

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{          
    UITableViewCell *outCell =(UITableCellView*)  [tableView dequeueReusableCellWithIdentifier:MyIdentifier];

     if (indexPath.row == 0)
     {
         UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, outCell);
     }
}

上記のアプローチはどれもうまくいきませんでした。他に何を試すことができますか、または上記のアプローチの何が問題になっていますか?

注意:Viewコントローラのドキュメントを読みました(https://developer.apple.com/LIBRARY/IOS/#featuredarticles/ViewControllerPGforiPhoneOS/Accessibility/AccessibilityfromtheViewControllersPerspective.html-VoiceOverカーソルを特定の要素に移動します)。私のサンプルにLayoutChanged通知とScreenChangedNotificationsを投稿してみました。また、サンプルコード(ListAdder- http: //developer.apple.com/library/ios/#samplecode/ListAdder/Introduction/Intro.htmlも使用しています。私たちと同じようにNavigationController)ですが、上記はサンプルでも機能しませんでした。

なぜですか?

4

1 に答える 1

0

画面変更通知を投稿することで、この問題を解決しました。その呼び出しの 2 番目のパラメーターは、最初のセルを選択するテーブル ビューのビューです。

UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, [[self nextTableViewController] ビュー];

于 2016-08-30T22:30:41.723 に答える