tvOS search: grid keyboard will not slide when search results are focused

347 views Asked by At

I am working on a tvOS application with a UISearchController. I have a problem when the grid keyboard is selected in the settings (Settings->General->Keyboard Layout).

Expected behavior

When the search results are focused, I expect the keyboard to slide to the leading edge to let the search results fill all the available width. This is the standard behavior in all Apple applications. But I can't get that behavior. The keyboard will stay when the search results are focused.

What I tried

I followed the video Discover search suggestions for Apple TV (the only one I could find where this topic was dealt with) and did everything mentioned:

  • Embed the UISearchController inside a UISearchContainerViewController (and the tab bar view controller is embed in a UINavigationController)
  • Set the collection view of the search results controller as the observed one with setContentScrollView(_) in the search results controller (as explained in the doc). searchControllerObservedScrollView being deprecated.

In the video, the behavior I expect is mentioned, and it seems that no additional steps are required to obtain it (~ 9'52''):

Our keyboard is highly adaptable to various languages and input methods. You should consider this when laying out your search results. Here are a few examples of alternate layouts. For people using IR remotes, we'll display a grid keyboard. While typing, the search results will only occupy some of the screen width, and then they'll slide in to fill the screen when focused.

Since we have to provide the search results view controller to the search controller, we don't have much control over the view hierarchy. Thus it seems quite natural that this behavior would come without extra work.

Environment

  • tvOS 15
  • UIKit
  • The problem exists on the Simulator as well as on the Apple TVs I tested: 4K (2nd generation) and HD

Other apps

Some apps like YouTube and Spotify expose the behavior I want. But I wonder if their search tab is implemented using UIKit or TVMLKit.

Follow up

  • This question is also asked on the Apple Developer Forums
  • I filed a bug through Feedback Assistant two months ago but did not get any answer so far. Still open.
0

There are 0 answers