1
我试图找到一种方法来在OS Sierra中将模式从浅色变为黑色。我有这样的更改设置:暗模式macOS塞拉利昂
CFPreferencesSetValue((CFStringRef)@"AppleInterfaceStyle", @"Dark", kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesCurrentHost);
这告诉OS挑上的变化:
dispatch_async(dispatch_get_main_queue(),
^{CFNotificationCenterPostNotification(CFNotificationCenterGetDistributedCenter(), (CFStringRef)@"AppleInterfaceThemeChangedNotification", NULL, NULL, true);}
);
但是,只有码头的变化,而不是通知和菜单栏。感谢您的任何帮助,您可以提供。
编辑:如果任何人有一个插入this function,这将是有益的关键列表。似乎无法在苹果文档中找到它。