-->

Lock orientation for custom tabs

2020-03-01 20:37发布

问题:

I would like to lock the orientation using Chrome Custom Tabs. Is this something I can do with the Low Level API or do I need to get a new method added for this functionality?

My use case is that I have an app that has custom tabs and I want it to always show the custom tab in portrait, never landscape.

回答1:

Custom Tabs does not currently provide an API that allows the developer to lock the orientation.

As a best practice, developers should always think twice before forcing a specific orientation, as it may be annoying to force the user to use one.

Locking the orientation looks more like something that should be decided by the content being opened inside the Custom Tabs (using an API like this) than something to be handled by the Custom Tab itself.