无法在本机脚本上仅使用浅色或深色主题

问题描述 投票:0回答:1

我正在开发具有Angular 8.2和@ nativescript / theme 2.2.1并具有scss主题的Nativescript(版本6.3.3)应用程序。我正在尝试仅使用深色(或仅浅色)主题,而不管系统模式(深色/浅色)如何,但似乎无济于事。我遵循了本指南https://github.com/NativeScript/theme,并使用了自定义颜色变量,将暗色设置为与亮色设置相同,但是它不起作用。有人可以支持我吗?

nativescript-angular app-themes android-darkmode
1个回答
0
投票

如果只想在iOS上强制使用亮或暗模式,则可以将以下内容添加到Info.plist文件中。

对于灯光模式:

    <key>UIUserInterfaceStyle</key>    
    <string>Light</string>    

对于黑暗模式:

    <key>UIUserInterfaceStyle</key>    
    <string>Dark</string>    

希望这会有所帮助!

© www.soinside.com 2019 - 2024. All rights reserved.