如何在我的Android应用中启用分屏? [英] How to enable split screen in my Android app?
问题描述
我想为我的Android应用程序启用分屏".如果我尝试拖动我的应用程序以使其占据我的android设备的上半部分,则会显示消息应用程序不支持分屏".但是,对于其他应用程序(例如Facebook和WhatsApp),我可以使用分屏显示.我正在将LGE Nexus 5X与支持分屏的Android 7(牛轧糖)一起使用.
I want to enable Split Screen for my android app. If I try to drag my app to make it occupy the top half of my android device it gives the message "App doesn't support split screen". However, for other apps such as Facebook and WhatsApp, I am able to use split screen. I am using LGE Nexus 5X with Android 7 (nougat) which supports split screen.
推荐答案
将其添加到AndroidManifest.xml
中的application
或activity
标记中:
Add this to your application
or activity
tag in AndroidManifest.xml
:
android:resizeableActivity=true
将其添加到application
将使所有活动均可实现,而将其添加到特定的activity
将使其他活动与调整大小不兼容.
Adding it to application
will make all activities realizable, while adding it to a specific activity
will keep other activities incompatible with resizing.
如果targetSdkVersion
为24(牛轧糖)或更高,则默认情况下将其设置为true(您仍然可以通过将param设置为false来将其关闭).
If your targetSdkVersion
is 24 (Nougat) or higher, this will be set to true by default (you can still turn it off by setting the param to false).
这篇关于如何在我的Android应用中启用分屏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!