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”。

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