Chromebook 上的应用呈现差异
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
由于 Android 应用在 ChromeOS 下的窗口中运行,因此应用在 Chromebook 上的呈现方式存在细微差异。以下段落将概述这些差异。
任务、窗口和透明度
任务由用户在运行应用时与之交互的一系列 activity 组成。任务在 ChromeOS 上显示为带有标题栏的窗口,应用相互层叠。这样,每个 activity 都可以是部分半透明的,以便底层显示。
在传统的 Android 应用中,上一个任务或桌面会在任务下方透出来。这样,半透明任务下方总会有可见的内容。
这在窗口环境中不起作用,原因如下:
- 窗口下方的可见内容无法控制,因此可以是任何内容。
- 完全透明的像素可以“神奇地”吞噬触摸或鼠标事件。
- 窗口元素在视觉上可能会与图片说明脱节,让用户与可能不相连的视觉元素感到困惑。
为了缓解此问题,适用于 ChromeOS 的 Play 会在每个窗口后面绘制一个半透明矩形。因此,在 ChromeOS 上运行时,应用永远不会 100% 透明,即使使用 Theme.Translucent.NoTitleBar
主题也是如此。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# App rendering differences on Chromebooks\n\nBecause Android apps run in a window under ChromeOS, there are small\ndifferences in how apps are rendered on Chromebooks. These differences are\noutlined in the following paragraphs.\n\nTasks, windows, and transparency\n--------------------------------\n\nA [task](/guide/components/tasks-and-back-stack)\nconsists of a stack of activities that the user interacts with when running an\napp. Tasks are presented on ChromeOS as a window with a title bar, with the\napps layered on top of each other. Each activity can then be\npartially translucent, letting the lower layers show through.\n\nIn a conventional Android app, the previous task or the desktop shows through beneath the task.\nIn this way, there is always something visible beneath a translucent task.\n\nThis does not work in a window environment, for the following reasons:\n\n- The visible content below a window cannot be controlled, and could therefore be anything.\n- Fully transparent pixels could \"magically\" swallow touch or mouse events.\n- Window elements might visually be disconnected from the caption, confusing the user with possibly unconnected visual elements.\n\nTo mitigate this problem, Play for ChromeOS draws a semitransparent rectangle behind\neach window. For this reason, apps can never be 100 percent transparent\nwhen running under ChromeOS, even when using the `Theme.Translucent.NoTitleBar`\ntheme."]]