Android填坑之旅(第十七篇)MIX2 适配看这一篇就够了,只需一行代码

感谢Sean_帅恩分享,非常感谢

MIX2 适配看这一篇就够了,18:9 只需一行代码

升级你的app以支持高长宽比的新旗舰

Android手机 全面屏(18:9屏幕)适配指南

属性介绍 resizeableActivity

added in API level 24 int resizeableActivity Indicates that it is okay
for this activity to be resized to any dimension. Intended for a
multi-window device where there can be multiple activities of various
sizes on the screen at the same time.

The default value is false for applications with targetSdkVersion
lesser than N and true otherwise.

NOTE: A task’s root activity value is applied to all additional
activities launched in the task. That is if the root activity of a
task is resizeable then the system will treat all other activities in
the task as resizeable and will not if the root activity isn’t
resizeable.

NOTE: The value of screenOrientation is ignored for resizeable
activities when in multi-window mode.

May be a boolean value, such as “true” or “false”.

翻译
resizeableActivity

在API级别24中添加 int resizeableActivity
表明该活动对任何维度进行调整是可以的。适用于多窗口设备,可以同时在屏幕上显示各种大小的多个活动。
对于具有targetSdkVersion小于N的应用程序来说,默认值是false,反之则不然。
注意:任务的根活动值应用于任务中所有的附加活动。也就是说,如果任务的根活动是可调整的,那么系统将把任务中的所有其他活动视为可调整的,并且如果根活动不可调整,则不会。
注意:当在多窗口模式下,屏幕定位的值被忽略了。 可能是一个布尔值,例如“true”或“false”。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章