三星Galaxy S8全屏模式 [英] Samsung Galaxy S8 full screen mode

查看:242
本文介绍了三星Galaxy S8全屏模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最新的三星智能手机有一个名为全屏的有趣功能(或在营销方面无限显示)。在此模式下,应用程序还包括显示主页/后退按钮的部分。通常的应用程序不会覆盖此区域,使其变黑。但三星的本土产品涵盖了这一领域。

Latest Samsung's smartphone has interesting feature called full screen (or in marketing terms infinity display). In this mode app covers also part of display where home/back buttons are. Usual apps don't cover this area, leaving it black. But Samsung's native ones cover this area.

问题:如何实现这种效果?我的意思是我应该使用什么样的清单声明或程序化调用(可能是三星的遗留API)?

Question: how to achieve this effect? I mean what kind of manifest declaration or programmatic call (possibly Samsung's legacy API) should I use?

推荐答案

启用新的三星Galaxy S8和LG G6全屏支持添加到< application> 元素下的AndroidManifest.xml:

To enable new Samsung Galaxy S8 and LG G6 full screen support add to the AndroidManifest.xml under the <application> element:

<meta-data android:name="android.max_aspect" android:value="2.1" />

其中2.1的值是宽高比18.5:9(默认情况下,您的应用默认为16的最大比率:9 - 1.86)。更多信息: Android博客

Where value of 2.1 is aspect ratio 18.5:9 (By default your App defaults to maximum ratio for 16:9 - 1.86). More info in: Android Blog.

或者,您可以为应用程序或活动设置以下属性:

Alternatively, you can set the following attribute for Application or Activity:

android:resizeableActivity="true"

因为文件说明(链接):


如果活动的
android:resizeableActivity属性设置为true,则无需设置最大宽高比。如果您的应用
定位API级别24或更高,则此属性默认为true。

You do not need to set a maximum aspect ratio if an activity's android:resizeableActivity attribute is set to true. If your app targets API level 24 or higher, this attribute defaults to true.

这篇关于三星Galaxy S8全屏模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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