目录

如何设置PC窗口透明

问题现象

使用setWindowBackgroundColor设置窗口背景色后,仅在手机和平板设备上生效,请问如何设置PC窗口的背景色?

背景知识

解决方案

由于PC窗口存在标题栏,因此设置PC窗口透明背景色需要setWindowBackgroundColor与setWindowContainerColor搭配使用,setWindowContainerColor设置标题栏透明,setWindowBackgroundColor设置内容区域背景色透明,方可实现整个PC窗口透明效果。示例代码如下: