gpt4 book ai didi

Android Nougat 多窗口 minHeight

转载 作者:行者123 更新时间:2023-11-30 00:59:31 26 4
gpt4 key购买 nike

有人试过为应用程序设置最小高度以在牛轧糖多窗口模式下使用吗?

试过了,

<activity android:name=".MyActivity">
<layout android:defaultHeight="500dp"
android:defaultWidth="600dp"
android:gravity="top|end"
android:minHeight="450dp"
android:minWidth="300dp" />
</activity>

我的引用是这样的:https://developer.android.com/guide/topics/ui/multi-window.html

但是,没发现有什么不同。

应用程序在多窗口中正常运行。应用程序的最小高度没有差异。

最佳答案

在分屏模式下,minHeight 不会更改 Activity 所在 Pane 的最小高度。但是,引用 the documentation :

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.

如果没有 minHeight,如果用户移动分隔线并调整您的 Activity Pane 的大小,您的 Activity 也会调整大小。

使用 minHeight,如果用户移动分隔线并且现在您的 Activity 的 Pane 小于 minHeight,您的 Activity 仍会呈现为 minHeight Canvas 。然而,然后该 Canvas 被裁剪,因此用户只能看到它的顶部 minHeight

最终,在自由形式窗口模式下,minHeight 的行为可能更像您对属性名称的期望,其中 Activity 窗口的大小不能调整为小于指定高度。

关于Android Nougat 多窗口 minHeight,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39638989/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com