仅在平板电脑上支持Android N +中的分屏 [英] Support split screen in Android N+ only on tablets

查看:320
本文介绍了仅在平板电脑上支持Android N +中的分屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以仅在足够大的屏幕(例如屏幕)上为活动配置多窗口支持平板电脑?

Is there a way to configure multi-window support for an activity only on screens large enough, e.g. tablet?

https://developer.android.com/preview/features/multi-window.html#configuring 没有提及.设置android:minimalHeightandroid:minimalWidth似乎无济于事,因为

https://developer.android.com/preview/features/multi-window.html#configuring doesn't mention that. Setting android:minimalHeight and android:minimalWidth seems to not help, because

如果用户在分屏模式下移动分隔线以使活动小于指定的最小值,则系统会将活动裁剪为用户要求的大小.

If the user moves the divider in split-screen mode to make an activity smaller than the specified minimum, the system crops the activity to the size the user requests.

用例:对于某些活动,以很小的屏幕(拆分)运行可能没有意义.在这种情况下,活动不应支持多窗口模式.

Use case: for certain activities, it might not make sense to be run in very small (split) screen sizes. In those situations, the activity should not support multi-window mode.

推荐答案

您可以使用标签创建多个APK(一个用于手机,一个用于平板电脑)

You could create multiple APKs (one for phone, one for tablet) using the tag

<supports-screens>

在清单中,然后仅在平板电脑APK上启用分屏支持.

in your manifest, and then enable split screen support only on the tablet APK.

这篇关于仅在平板电脑上支持Android N +中的分屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆